Excel SUMIF
SUMIF adds the numbers on rows that meet a single condition.
A finance assistant has one long expense log and needs a figure for each department. Sorting and adding by hand is slow and easily broken. SUMIF asks one question of the whole list and gives the department total straight away.
Practice it nowHow to write it
=SUMIF(range, criteria, [sum_range])- range
- The cells to test.
- criteria
- The condition to meet.
- sum_range
- Optional cells to add, if different from the tested cells.
Watch it work
D2fx
ABCDE
1DeptAmount
2Marketing540
3IT1200
4Marketing310
5HR95
6IT460
7Ops720
8
1
Examples
Total spent by Marketing
=SUMIF(A2:A7,"Marketing",B2:B7)850Test column A and add the matching amounts in column B.
Add only amounts above 500
=SUMIF(B2:B7,">500")2,460When the tested cells are also the numbers, leave out the third argument.
Everything except IT
=SUMIF(A2:A7,"<>IT",B2:B7)1,665The <> operator means not equal to.
Your turn
Total the amounts spent by IT. Type your formula in D2.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Dept | Amount | ||
| 2 | Marketing | 540 | ||
| 3 | IT | 1200 | ||
| 4 | Marketing | 310 | ||
| 5 | HR | 95 | ||
| 6 | IT | 460 | ||
| 7 | Ops | 720 | ||
| 8 |
Common mistakes
Mixing up the order with SUMIFS.
SUMIF has the numbers last. SUMIFS has them first.
A sum range of a different size.
Excel sizes it from the first cell, which can add the wrong rows. Keep both ranges the same height.
Good to know
- Use "*" for partial matches, such as "Mark*".
- Put the condition in a cell so one formula copies down a summary table.
- SUMIF or SUMIFS? If there is any chance you will need a second condition later, start with SUMIFS.
Excelio