Reputation: 11
I have a table in Excel where I have categories and money like so:
I want to calculate the sum of all A category and B And C.
So I have to put a rule like this for the cell B1
=if(cell next B1 witch is A1="a";get B1)
and do the same for all other cells in B row.
How can I get the total of money collected from category A and from category B?
Upvotes: 1
Views: 20442
Reputation: 3960
If I understand you correctly: in cell E2 use the following formula:
=SUMIF($A$2:$A$19,D2,$B$2:$B19)
and copy down. Change the ranges to suit your situation.
Upvotes: 2
Reputation: 39
use SumIf this checks Col A for the character "a" and adds up the value in B
=SUMIF(A:A,"a",B:B)
Upvotes: 0
Reputation: 4522
Have a look at the SUMIFS
function. For example, in E2 you might put
=sumifs(b$2:b$19, a$2:a$19, d2)
Upvotes: 3