sumif

S

sumif

If I have two column as below:
(ColumnA) (Column B)
1. Apple 35
2. Orange 5
3. Banana 9
4. Pear 25
5. Banana 18
6. Apple 56
7. Orange 36
8. watermelon 66
9. Orange 14
10.Apple 5
If I use SumIf like this =SUMIF(A1:A5,"Banana",B1:B5), it only come up 18+9
= 27.
How can I sum up more than two items in the ColumA, like sum up "Pear" +
"Apple" +"Orange" together.
 
D

Dave Peterson

You could use multiple =sumif()'s:

=SUMIF(A1:A5,"apple",B1:B5)
+SUMIF(A1:A5,"pear",B1:B5)
+SUMIF(A1:A5,"orange",B1:B5)

Or you could use something like:
=sum(SUMIF(A1:A5,{"apple","pear","orange"},B1:B5))

Adjust your range...I bet it doesn't stop with row 5.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top