Jorge GVD
Jorge GVD

Reputation: 43

Sum column only of rows that match a condition (of another column)

I have a spreadsheet in Google with the following data:

**Status         Amount**
Under Review    $120.00
Delivered       $50.00
Paid            $320.00
Paid            $110.00
Under Review    $200.00

I want to sum all the column Amount, only but of only of those rows that has a Status on 'Delivered' or 'Paid'

With my example, the SUM should return $480.00.

I was trying with this formula, but it isn't working

=SUMIF(Column Amount,Status={"Delivered","Paid"},Column Amount)

Any ideas? Thanks a lot!

Upvotes: 4

Views: 1498

Answers (2)

marikamitsos
marikamitsos

Reputation: 10573

You can also use the following formula:

=SUM(QUERY(A2:B,"select sum(B) where A='Paid' or A='Delivered' group by A"))

enter image description here

Upvotes: 5

Joundill
Joundill

Reputation: 7533

One of your columns is incorrect, and you need to use the arrayformula function. Documentation here

=SUM(ARRAYFORMULA(SUMIF([status_column],{"Delivered","Paid"},[amount_column])))

Upvotes: 2

Related Questions