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

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

Master Conditional Sums with SUMIF and SUMIFS (Dates, Text, 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 numbers of rows and columns.

Single Criterion — SUMIF

Example 1) Total sales for category = “Keyboard”

=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 item = Keyboard

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

Example 4) Item = 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 Totals (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 containing the 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))  // note the array behavior

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

Include or Exclude Text and Wildcards

Example 9) Items containing “Pro”

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

Example 10) Exclude “Refurbished”

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

Example 11) Codes with exactly 3 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 aggregation with FILTER (Microsoft 365)

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

Example 14) Reuse values 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 sure every range has the same number of rows and columns.
  • Numbers stored as text → Convert them with VALUE or standardize the source format.
  • Blank cells vs. 0 → The criterion "=" applies only to blank cells, while =0 applies to cells with a value of 0.
  • Overusing full-column references → Use precise ranges or tables for better speed.
  • Case sensitivity → SUMIF/SUMIFS are not case-sensitive. When needed, use SUMPRODUCT(EXACT(...)*value).

Summary

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

FAQ

What are the advantages compared with a PivotTable?

PivotTables are great for summarizing and analyzing data, while SUMIFS calculates directly in cells, 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 BYROW/FILTER for flexible handling.

Choose one monthly or category total in your current 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 *