Conditional Sums with SUMIF and SUMIFS

Conditional Sums with SUMIF and SUMIFS (Dates, Text, and Multiple Criteria)

Conditional Sums with SUMIF and SUMIFS (Dates, Text, and Multiple Criteria)

Calculate conditional sums instantly without a PivotTable. Automate combinations of dates, categories, regions, and statuses with SUMIF/SUMIFS.

Basic Syntax and Differences

FunctionSyntaxKey Point
SUMIF=SUMIF(criteria_range, criteria, [sum_range])One criterion. If sum_range is omitted, Excel sums criteria_range.
SUMIFS=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)Enter the sum range first, then list criteria pairs.

TIP: All ranges must be the same size (with matching rows and columns).

Single Criterion — SUMIF

Example 1) Total sales for the “Keyboard” category

=SUMIF(A2:A100, "Keyboard", C2:C100)

Example 2) Amount ≥ 50,000

=SUMIF(C2:C100, ">=50000")

Enter the operator and number as a text string, or join the operator to a cell value: ">="&F2

Multiple Criteria — SUMIFS (AND/OR)

Example 3) Region=Seoul AND product=Keyboard

=SUMIFS(C2:C100, A2:A100, "Keyboard", B2:B100, "Seoul")

Example 4) Product=Keyboard OR Mouse

=SUM(SUMIFS(C2:C100, A2:A100, "Keyboard"),
     SUMIFS(C2:C100, A2:A100, "Mouse"))

Example 5) OR criteria with multiple values (list reference)

=SUMPRODUCT(SUMIFS(C2:C100, A2:A100, F2:F5))

In Microsoft 365:

=SUM(SUMIFS(C2:C100, A2:A100, F2:F5))  // sum spilled results

Date Range Sums (Monthly/Period)

Example 6) 2025-08-01 to 2025-08-31

=SUMIFS(C2:C100, B2:B100, ">="&DATE(2025,8,1), B2:B100, "<="&DATE(2025,8,31))

Example 7) Total for the month of the reference date in F2

=SUMIFS(C:C, B:B, ">="&EOMONTH(F2,-1)+1, B:B, "<="&EOMONTH(F2,0))

Example 8) Last business day of the month only (bonus)

=SUMIFS(C:C, B:B, WORKDAY(EOMONTH(B:B,0),-1))  // array caution

In practice, the most reliable approach is to create month or quarter labels in a helper column and summarize them.

Include or Exclude Text and Wildcards

Example 9) Products containing “Pro”

=SUMIFS(C2:C100, A2:A100, "*Pro*")

Example 10) Exclude “Refurbished”

=SUMIFS(C2:C100, D2:D100, "<>*Refurbished*")

Example 11) Codes with exactly three characters (the ? wildcard)

=SUMIFS(C2:C100, A2:A100, "???")

Tables, Dynamic Arrays, and Alternative Formulas

Example 12) Table (recommended) — readability and automatic ranges

=SUMIFS(Sales[Amount], Sales[Item], "Keyboard", Sales[Region], "Seoul")

Example 13) Alternative calculation with FILTER (Microsoft 365)

=SUM(FILTER(C2:C100, (A2:A100="Keyboard")*(B2:B100="Seoul")))

Example 14) Reuse formulas and improve performance with LET

=LET(it,A2:A100, rg,B2:B100, val,C2:C100,
  SUMIFS(val, it,"Keyboard", rg,"Seoul"))

Mistakes, Errors, and Performance Tips

  • Mismatched range sizes → Make the row and column counts the same for all ranges.
  • Numbers stored as text → Convert them with VALUE or standardize the source format.
  • Blank cells vs. 0 → The criterion "=" matches blank cells only; =0 matches cells with a value of 0.
  • Overusing whole-column references → Use exact ranges or tables (for better speed).
  • Case sensitivity → SUMIF/SUMIFS are not case-sensitive. If needed, use SUMPRODUCT(EXACT(...)*value).

Summary

GoalTypical Formula
Single criterionSUMIF(criteria_range, criteria, sum_range)
Multiple criteria (AND)SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2)
Multiple criteria (OR)SUM(SUMIFS(...), SUMIFS(...)) or SUMPRODUCT
Date period">="&start_date, "<="&end_date
Wildcards* (multiple characters), ? (one character), ~ (escape)

FAQ

What are the advantages compared with a PivotTable?

PivotTables are excellent for summarizing and analyzing, while SUMIFS calculates instantly within a cell, making it suitable for formula-based reports. Using both together is ideal.

What if I have more than 10 criteria?

Use a list (spilled range) with SUMPRODUCT(SUMIFS(..., criteria_range, list)), or use Microsoft 365's BYROW/FILTER for flexible handling.

Choose one monthly or category total in your report and convert it to SUMIFS. Combining it with helper columns and tables also makes maintenance easier.

Leave a Reply

Your email address will not be published. Required fields are marked *