Search code examples
arraysif-statementgoogle-sheetssumarray-formulas

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


Solution

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

    0