The SUMIFS function
SUMIFS is SUMIF with as many conditions as you need. It adds a row only when *all* the conditions are true: this region and this product, or this month and over £500.
It works with one condition too, so many people use SUMIFS for everything and never need to remember SUMIF's different argument order.
=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
Arguments
- sum_range
- The cells to add up. Note that this comes first in SUMIFS.
- criteria_range1
- The first column to test.
- criteria1
- The condition for that column: a value like "North", a cell, or a comparison like ">500".
- criteria_range2, criteria2, ...optional
- More range and condition pairs. A row is added only if it meets every condition.
Try it
=SUMIFS(D2:D7,A2:A7,"North",C2:C7,"Laptop") in F2. Two rows are both North and Laptop (Priya's and Sam's), so SUMIFS adds £899 + £899.
F2
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Region | Rep | Product | Amount | North laptops | ||
| 2 | North | Priya | Laptop | £899.00 | £1,798.00 | ||
| 3 | South | Tom | Laptop | £949.00 | |||
| 4 | North | Priya | Monitor | £189.00 | |||
| 5 | North | Sam | Laptop | £899.00 | |||
| 6 | South | Tom | Monitor | £210.00 | |||
| 7 | East | Ana | Laptop | £925.00 | |||
| 8 | |||||||
| 9 |
Edit the formula in F2, or change the data, and press Enter.
More examples
| Formula | Result | What it does |
|---|---|---|
| =SUMIFS(D2:D7,C2:C7,"Laptop",D2:D7,">900") | £1,874.00 | Laptop sales over £900. The sum range can also be a criteria range. |
| =SUMIFS(D2:D7,A2:A7,"North",B2:B7,"Priya") | £1,088.00 | Everything Priya sold in the North. |
| =SUMIFS(D2:D7,A2:A7,"<>North") | £2,084.00 | One condition is fine: every region except North. |
| =SUMIFS(D2:D7,A2:A7,"North",C2:C7,"Laptop")+SUMIFS(D2:D7,A2:A7,"East",C2:C7,"Laptop") | £2,723.00 | SUMIFS only does AND. For North or East, add two SUMIFS together. |
Tips
- Put the conditions in cells and refer to them, so one formula can be copied across a summary table.
- For a date window, use two conditions on the same column:
">="&G1and"<="&G2. - Lock the ranges with
$before filling the formula down or across.
Common mistakes
- The total is wrong after switching from SUMIF.SUMIFS puts the sum range first; SUMIF puts it last. Check the first argument is the column of amounts.
- #VALUE! appears.The ranges are different sizes. Every range must cover the same rows, e.g. all
2:7. - The total is 0.Usually one condition doesn't match anything: a spelling difference, an extra space, or numbers stored as text in the amount column.
Practise SUMIFS with instant feedback
Type real formulas into a working spreadsheet and get told straight away whether they work.