mr.moe
mr.moe

Reputation: 59

Google Spreadsheet: If certain value in column exists + formula

I have a list with expenses — some of them are monthly and some of them are yearly expenses. Next to them, there is a column with data validation (2 values = monthly/yearly).

Below everything, I'd like to display the total expenses on a yearly basis.

So for the whole column, it should be something like:

If monthly, then tablecell*12, otherwise — just add the values.

How do I achieve that?

EDIT: Here is an example

Upvotes: 2

Views: 346

Answers (2)

player0
player0

Reputation: 1

=SUMPRODUCT(ARRAYFORMULA(IF(C1:C4="monthly",B1:B4*12,B1:B4)))

0

Upvotes: 2

Sujit
Sujit

Reputation: 1792

Something like this I suppose...

enter image description here

somewhere to the right of where you've written yearly/monthly type in:

=IF(B:B="monthly",A:A*12,A:A)

And then at the bottom type in:

=SUM(C:C)

Make sure this sum is not in column 'C'

Upvotes: 1

Related Questions