Search code examples
excelexcel-formulasumifs

How to sumif a row?


My table looks like this

Month     January    February
Apple       50           50
Orange      10           10
Grapes      5             5

When I try to sumif Apple like =sumif(A2:A4,"Apple",B2:C4) it only gives me 50 from January and not the whole line. The answer I need is 100.

How should I edit the formula?


Solution

  • Use SUMPRODUCT instead: =SUMPRODUCT((A2:A4="Apple")*B2:C4)