Google-sheets – How to filter and sum cells in Google Spreadsheet

google sheets

I have a list of families invited to my wedding, formatted like this

Name  | Who invited  | How much will come? 
------------------------------------------
Johes | Bride        | 2
Smits | Groom        | 3
...

And I want to add two cells that will come totals for "How much will come?" for Bride and for Groom separately. Is there any way to do this using formulas?

Best Answer

The following formula will do that.

Formula

=QUERY(A1:C3, "SELECT A, SUM(C) GROUP BY A PIVOT B")

Screenshot

enter image description here