Excel functions · Conditional math

SUMIFS function in Excel

SUMIFS adds up the numbers in a range for the rows that meet every condition you give it, such as total sales for the South region or for one rep and one product. It takes the range to sum first, then pairs of criteria ranges and criteria.

Last reviewed

Syntax

=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
sum_rangerequired
The cells to add up.
criteria_range1required
The cells to test against criteria1. Same size as sum_range.
criteria1required
The condition, such as "South", ">=1000" or a cell reference.
criteria_range2, criteria2, ...optional
More range and condition pairs, up to 127. A row is added only when it meets all of them.
  • Criteria are text: "South", ">=1000", "<>North", or ">"&G1 to compare with a cell. * and ? work as wildcards, and matching ignores case.
  • Conditions are combined with AND. For OR, add two SUMIFS together, or use SUMPRODUCT.
  • SUMIF (no S) takes one condition and puts sum_range last; SUMIFS puts it first.

Which versions have SUMIFS

Every current Excel version: Microsoft 365, Excel for the web, Excel 2024, 2021, 2019 and 2016, on Windows and Mac.

SUMIFS availability by Excel version
VersionHas it
Microsoft 365 (Windows and Mac)Yes
Excel for the webYes
Excel 2024Yes
Excel 2021Yes
Excel 2019Yes
Excel 2016Yes

Google Sheets

Google Sheets has SUMIFS with the same arguments and criteria syntax.

Examples

The examples use this sample sheet.

Orders (A1:E9)
RowABCDE
1Order IDRepRegionProductAmount
21001AnaNorthLaptop1200
31002BenSouthMonitor300
41003AnaNorthMonitor350
51004CaraEastLaptop1150
61005BenSouthLaptop1250
71006DevWestKeyboard80
81007CaraEastMonitor320
91008AnaSouthKeyboard90
  1. 1.Total for one region

    =SUMIFS(E2:E9, C2:C9, "South")

    Result: 1640

    South has orders of 300, 1,250 and 90.

  2. 2.Two conditions

    =SUMIFS(E2:E9, B2:B9, "Ana", D2:D9, "Laptop")

    Result: 1200

    Only order 1001 is both Ana's and a laptop.

  3. 3.Condition on the summed column

    =SUMIFS(E2:E9, E2:E9, ">=1000")

    Result: 3600

    The three orders of 1,000 or more: 1,200 + 1,150 + 1,250.

Common errors and fixes

SUMIFS errors, causes and fixes
ErrorWhy it happensFix
#VALUE!sum_range and a criteria range are different sizes, such as E2:E9 and C2:C10.Make every range cover the same rows.
0 when you expect a totalThe criteria text doesn't match (extra spaces), or the numbers are stored as text.Clean the data with TRIM, and convert text numbers with VALUE or Text to Columns.

Do it with GPTExcel

Skip writing SUMIFS by hand

Upload your Excel or CSV file to Chat and ask in plain English. GPTExcel writes the formula for your file and your version of Excel or Google Sheets.

your-file.xlsx

Total the sales by region and by rep, and flag any rep below 1,000.

Done. I used SUMIFS on your sheet and checked the results against your data.

your-file-updated.xlsxYour original stays unchanged
  • Written for your platform and version
  • Checked against your actual data
  • Newest functions looked up in official docs
Try it free Formula Generator

Free plan, no credit card.

SUMIFS questions

What's the difference between SUMIF and SUMIFS?
SUMIF handles one condition and its sum range comes last. SUMIFS handles one or more conditions and its sum range comes first. SUMIFS covers everything SUMIF does, so it's a good habit to use it always.
How do I use SUMIFS with OR?
SUMIFS joins conditions with AND. For OR, add two SUMIFS: =SUMIFS(E2:E9, C2:C9, "East") + SUMIFS(E2:E9, C2:C9, "West") returns 1,550 on the sample data.
How do I use a cell value as the condition?
Put the cell directly for an equal match, like C2:C9, G1. For comparisons, join the operator and the cell with &: ">="&G1.

Skip the formula hunt

Upload a spreadsheet and ask in plain English. Free plan, no credit card.

Start free