Spreadsheet Practice

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
Category
Conditional sum and count functions
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])

ArgumentRequired?What it is
rangeRequiredThe cells to check against the condition.
criteriaRequiredThe condition, such as "Travel", ">500" or a cell reference.
sum_rangeOptionalThe 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.

CellFormulaResultWhat it shows
F2=SUMIF(B2:B8,"Travel",C2:C8)$2,030Checks column B, adds the matching amounts from C
F3=SUMIF(C2:C8,">500")$2,820No 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
DateCategoryAmountCheckResult
4/2/2026Travel$640Travel total$2,030
4/3/2026Meals$85Items over $500$2,820
4/7/2026Software$1,200Everything but travel$1,577
4/9/2026Travel$410
4/14/2026Meals$62
4/18/2026Travel$980
4/22/2026Office$230

Practice SUMIF

From lesson 7, COUNTIF & SUMIF. Graded instantly, then re-checked on changed data.

Sum by region

In G3, total the amounts for the West region.

Common mistakes

What you seeWhy, and how to fix it
The total is 0Usually a mismatch: extra spaces, a typo in the criterion, or numbers stored as text in the sum range.
Mixing up the argument order with SUMIFSSUMIF puts the sum range last; SUMIFS puts it first. Many people use SUMIFS everywhere to avoid the switch.
Totals are wrong after filling downLock 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.