SUMIF function
SUMIF adds up values for the rows that meet one condition: total travel expenses, revenue for one product, every invoice over $500. It checks one range and adds the matching cells from another. If you leave out the sum range, it adds the checked cells themselves.
- Available in
- Every current version
- Returns
- The total of the matching values, or 0 if nothing matches.
- Google Sheets
- Also available in Google Sheets.
Syntax
=SUMIF(range, criteria, [sum_range])
| Argument | Required? | What it is |
|---|---|---|
range | Required | The cells to check against the condition. |
criteria | Required | The condition, such as "Travel", ">500" or a cell reference. |
sum_range | Optional | The cells to add. If omitted, SUMIF adds the cells in range. |
Examples
Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.
| Cell | Formula | Result | What it shows |
|---|---|---|---|
| F2 | =SUMIF(B2:B8,"Travel",C2:C8) | $2,030 | Checks column B, adds the matching amounts from C |
| F3 | =SUMIF(C2:C8,">500") | $2,820 | No sum range: adds the checked cells themselves |
| F4 | =SUMIF(B2:B8,"<>Travel",C2:C8) | $1,577 | "<>" means "not equal to" |
Try it live
This is the sample sheet. Change any number or text, or edit a formula, and the results update.
Show the sample data as a table
| Date | Category | Amount | Check | Result | |
| 4/2/2026 | Travel | $640 | Travel total | $2,030 | |
| 4/3/2026 | Meals | $85 | Items over $500 | $2,820 | |
| 4/7/2026 | Software | $1,200 | Everything but travel | $1,577 | |
| 4/9/2026 | Travel | $410 | |||
| 4/14/2026 | Meals | $62 | |||
| 4/18/2026 | Travel | $980 | |||
| 4/22/2026 | Office | $230 |
Practice SUMIF
From lesson 7, COUNTIF & SUMIF. Graded instantly, then re-checked on changed data.
Sum by region
G3, total the amounts for the West region.Common mistakes
| What you see | Why, and how to fix it |
|---|---|
| The total is 0 | Usually a mismatch: extra spaces, a typo in the criterion, or numbers stored as text in the sum range. |
| Mixing up the argument order with SUMIFS | SUMIF puts the sum range last; SUMIFS puts it first. Many people use SUMIFS everywhere to avoid the switch. |
| Totals are wrong after filling down | Lock the ranges with $ and point the criterion at the cell in each row. |
Tips
- Put each category in a cell and use =SUMIF($B$2:$B$8,E2,$C$2:$C$8) to build a summary table you can fill down.
Questions
How do I sum based on text in another column?
Use =SUMIF(B2:B8,"Travel",C2:C8): check column B, add from column C.
How do I sum values greater than a number?
Use =SUMIF(C2:C8,">500"). The comparison goes in quotes.
What is the difference between SUMIF and SUMIFS?
SUMIF handles one condition with the sum range last. SUMIFS handles one or more conditions with the sum range first.
Lessons that use SUMIF
Last reviewed October 2026. Every example result on this page is calculated live by the Spreadsheet Practice formula engine.