1

I have a table in Excel where I have categories and money like so:

enter image description here

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?

1
  • Look up Pivot Tables. Commented Oct 18, 2013 at 16:15

3 Answers 3

3

Have a look at the SUMIFS function. For example, in E2 you might put

=sumifs(b$2:b$19, a$2:a$19, d2) 
Sign up to request clarification or add additional context in comments.

2 Comments

sumifs may be overkill because the OP only has a single criteria. Plus that function is only available in Excel 2007 and greater.
@sous2817 True, but I tend to prefer it over SUMIF for maintainability reasons: if I need to add more conditions later, and it's a SUMIF, I have to re-order the parameters to convert it to SUMIFS.
2

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.

Comments

0

use SumIf this checks Col A for the character "a" and adds up the value in B

=SUMIF(A:A,"a",B:B) 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.