How to use SUMIF to add up one customer's rows
You have a column of amounts and you only want the ones belonging to a single customer. SUMIF checks each row against one rule and adds up the amounts that pass.
The formula
=SUMIF(A:A,"Acme",B:B) in column D
What each part does
A:A- The column to look in. Every cell in column A is checked.
"Acme"- What to look for. Put text in quotes; a cell reference needs none.
B:B- The column to add up. Only the rows that matched are included.
How it works, and what to watch for
The general idea: SUMIF adds numbers, but only from the rows that match a condition you give it. Everything else is skipped.
The order of the three parts trips people up, because it is not the same as SUMIFS. In SUMIF the column you check comes first and the column you add comes last. In SUMIFS the column you add comes first. If you use both, it is worth using SUMIFS everywhere so the order is always the same.
The condition does not have to be text in quotes. Point it at a cell instead, and the total follows whatever that cell says, which is how a one-cell report is usually built.
A condition can also be a comparison written as text, such as ">1000". Written that way it adds every row above a thousand.
Questions
What is the difference between SUMIF and SUMIFS?
SUMIF takes one condition, SUMIFS takes several. Their argument order also differs: SUMIF ends with the column to add, SUMIFS starts with it. Using SUMIFS for everything avoids the confusion.
Can I add up rows above a certain number?
Yes. Use a comparison in quotes, such as =SUMIF(B:B,">1000",B:B), which adds every amount over a thousand.
Why is my total zero?
The condition matched nothing. The usual causes are a stray space in the data, or a name spelled differently from the one in the formula. Wrapping the column in TRIM clears the spaces.
The example sheet
| Customer |
Amount |
Acme total |
| Acme |
1200 |
|
| Bellrose |
800 |
|
| Acme |
450 |
|
| Larkspur |
600 |
|
| Acme |
300 |
|
If this helped, these are close by
More on SUMIF, and every walkthrough that uses it.