Google Sheets function · Math
SUMIFS in Google Sheets: syntax and examples
SUMIFS adds the values in sum_range for rows where every condition is true. Each condition is a pair of a range and a criterion, and all ranges must have the same size.
Syntax
SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, criterion2, ...])
Arguments
| Argument | Type | Required | What it does |
|---|---|---|---|
sum_range | range | yes | The cells to add up. It is always the first argument, unlike SUMIF. |
criteria_range1 | range | yes | The first range the condition is tested on. It must have the same size as sum_range. |
criterion1 | any | yes | The condition: a value, a comparison such as ">=5", or a pattern with * and ?. |
criteria_range2 | range | no | A second range to test. Rows must pass every condition to be added. |
criterion2 | any | no | The condition for criteria_range2. Add more range and criterion pairs as needed. |
Examples
The examples use this table, starting in A1:
| Region | Product | Units | Revenue |
| North | Lamp | 10 | 799 |
| South | Lamp | 4 | 319.6 |
| North | Chair | 2 | 1098 |
| South | Chair | 5 | 2745 |
| North | Lamp | 6 | 479.4 |
=SUMIFS(D2:D6, A2:A6, "North")Result: 2376.4
Revenue of one region: a single condition, same as SUMIF but with sum_range first.
Run in a Google Sheet (English US locale) on .
=SUMIFS(D2:D6, A2:A6, "North", B2:B6, "Lamp")Result: 1278.4
Two conditions at once. A row is added only when both match.
Run in a Google Sheet (English US locale) on .
=SUMIFS(C2:C6, C2:C6, ">=5")Result: 21
The same column is both the sum range and the test range: add only the order lines with 5 units or more.
Run in a Google Sheet (English US locale) on .
=SUMIFS(D2:D6, B2:B6, "<>Lamp")Result: 3843
Everything except one product, using the <> operator.
Run in a Google Sheet (English US locale) on .
=SUMIFS(D2:D6, B2:B6, "L*")Result: 1598
A wildcard: * stands for any text, so the criterion matches every product starting with L.
Run in a Google Sheet (English US locale) on .
Common errors
- Every criteria range must have exactly as many rows and columns as sum_range. A2:A5 against D2:D6 returns #VALUE!.
- Each criteria range needs its own criterion. A range left without one returns #N/A.
- Conditions are joined with AND. To add rows that match one condition or another, add two SUMIFS together.
- Text criteria ignore case, and a comparison such as ">=5" is written as text in quotes. To use a cell value, join it: ">="&F1.
Compared with Excel
Same syntax and argument order as Excel SUMIFS.