Add numbers depending on other cells

B

babygoode

Hi,

I need to add up some values depending what is in the cell next to
them

A B
1 Cat 2
2 Dog 3
3 Cat 5
4 Rabbit 6

So i need to add up all the numbers in colum B that are next to cat -
is this possible?

Thanks,
 
B

bill k

=SUMIF(a1:a4, "cat",b1:b4)

or

=SUMIF(a1:a4,c1,b1:b4)

so that you can enter cat or rabbit in c1
 
Top