formulastreak

Conditional totals function

SUMIFS function in Google Sheets and Excel

SUMIFS adds the numbers in a range on the rows that meet every condition you give it.

Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet

Syntax

SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], …)

Arguments in [brackets] are optional. Google Sheets writes it SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, criterion2, ...]).

Example

=SUMIFS(F2:F13,E2:E13,"Plants",H2:H13,"Shipped") reads: Add the quantities F2:F13 on the rows where the category E2:E13 is Plants and the status H2:H13 is Shipped.

Leaf & Loam orders · edit K1 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultK1 = 14
ABCDEFGHIJK
1OrderDateCustomerProductCategoryQtyPriceStatusPlants shipped14
210012 Mar 2026Mara OkaforMonsteraPlants1$34.00Shipped
310022 Mar 2026Jonas LindTerracotta potPots3$12.50Shipped
410033 Mar 2026Priya RamanSnake plantPlants2$22.00Shipped
510044 Mar 2026Tomás RuizWatering canTools1$18.00Pending
610055 Mar 2026Elif DemirFernPlants4$9.50Shipped
710065 Mar 2026Mara OkaforPotting mixSoil2$7.25Returned
810076 Mar 2026Kenji MoriPruning shearsTools1$24.00Shipped
910087 Mar 2026Ines VargaCeramic potPots2$19.00Pending
1010098 Mar 2026Jonas LindMonsteraPlants1$34.00Shipped
1110109 Mar 2026Sofia RossiFernPlants6$9.50Shipped
12101110 Mar 2026Priya RamanPotting mixSoil5$7.25Shipped
13101211 Mar 2026Leo BrandtSnake plantPlants1$22.00Pending

K1 shows 14: the quantities of the Plants orders that have shipped (1 + 2 + 4 + 1 + 6, but not the pending Snake plant).

How the spreadsheet calculates it

Adds up the values in F2:F13 on the rows where E2:E13 is equal to "Plants" and H2:H13 is equal to "Shipped".

  1. 1. SUMIFS: Adds up the values in F2:F13 on the rows where E2:E13 is equal to "Plants" and H2:H13 is equal to "Shipped".
    • sum_range = `F2:F13`: the cells to add
    • range1 = `E2:E13`: the first column to check
    • criteria1 = `"Plants"`: what it must match
    • range2 = `H2:H13`: the next column to check
    • criteria2 = `"Shipped"`: what that must match

More SUMIFS examples

  • =SUMIFS(F2:F13,E2:E13,"Plants")Total quantity of plant orders.
  • =SUMIFS(F2:F13,B2:B13,">="&K1,B2:B13,"<="&K2)Total between two dates in K1 and K2.
  • =SUMIFS(F2:F13,D2:D13,"*pot*")Total for products whose name contains “pot”.
  • =SUMIFS($E$2:$E$17,$B$2:$B$17,$H2,$C$2:$C$17,I$1)One formula for a whole region × product grid.

Paste any of these into the formula explainer to see it step by step.

Tips

  • Keep criteria in cells and join operators with &, so totals update when someone changes K1.
  • Lock the ranges with $ before filling a summary grid across and down.
  • Check a total once against a filtered view of the same rows before trusting it.
  • Use the same rows for every range: if sum_range is F2:F13, every criteria range ends on row 13 too.

What SUMIFS is used for

Monthly sales by region, spend by category and month, hours by project and person: any total that needs filtering first, and the summary grids most reports are built from.

Arguments

ArgumentRequiredWhat it is
sum_rangeYesThe numbers to add. In SUMIFS it comes first.Watch out: Pointing it at text adds nothing: the total is 0.
criteria_range1YesThe range to test against the first condition, the same size as sum_range.
criteria1YesThe condition: text in quotes, a number, a comparison in quotes like ">=3", a cell, or a wildcard.
criteria_range2, criteria2NoMore range and condition pairs. A row counts only if it meets all of them.

Common mistakes

  • Copying SUMIF's order and putting the sum range last.

  • Expecting OR logic: every condition must match.

  • Writing a cell inside the quotes, like ">=K1": join it instead, ">="&K1.

  • Expecting OR between conditions: add two SUMIFS together.

In Google Sheets

Google Sheets' SUMIFS has the same arguments in the same order, sum range first.

Errors you may see with SUMIFS

  • #VALUE!: A criteria range isn't the same size as sum_range, or the formula reads a closed workbook.

Questions

Why does SUMIFS return 0?

No row meets every condition: usually a typo, a space or text-numbers. See SUMIFS returns 0.

How do I sum between two dates?

Use the date column twice: SUMIFS(F2:F13, B2:B13, ">="&K1, B2:B13, "<="&K2). See SUMIFS dates not working.

Does the order of the conditions matter?

No. Each condition must match, whatever order you list them in; only the sum range has to come first.

Sources

Official documentation the facts on this page were checked against.

Practise SUMIFS on a live sheet

Lesson 19, SUMIFS (Unit 5, Conditional totals), has 5 graded exercises, checked instantly, with steps and hints when you're stuck. Pro