Curious Minds

Clear answers to science and history questions

SUMIFS Formula: How It Works with Examples

· 6 min read · Science

The SUMIFS formula adds up the values in a range that meet one or more criteria. It checks each criterion against a corresponding range and sums only the numbers in the sum range where every condition is true. In Excel and Google Sheets, the syntax is =SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...). The sum_range comes first, followed by pairs of criteria ranges and criteria. All ranges must be the same size, and the formula returns a single total.

Background: Why SUMIFS Exists

Before SUMIFS, users relied on SUMIF for single-condition totals or on array formulas for multiple conditions. SUMIFS was introduced in Excel 2007 to make multi-criteria summing straightforward and efficient. It is now a standard function in Excel, Google Sheets, LibreOffice Calc, and most modern spreadsheet programs. The function belongs to the math and trigonometry category and is often paired with COUNTIFS, AVERAGEIFS, and MAXIFS for conditional analysis.

SUMIFS is not case-sensitive for text criteria, and it ignores text or logical values in the sum range unless they can be coerced to numbers. It also does not require the criteria ranges to be adjacent to the sum range, which gives flexibility in layout.

How SUMIFS Works Step by Step

SUMIFS evaluates each criteria pair independently and combines them with AND logic. A row is included in the sum only if every criterion is satisfied. The formula processes ranges in parallel: the first cell of each criteria range is checked against its criterion, then the second cell, and so on. When all conditions match for a given position, the corresponding value in the sum range is added.

  1. Identify the sum range: the column or row containing the numbers to add.
  2. List each criteria range: the range to test for a condition. Each must be the same dimensions as the sum range.
  3. Specify each criterion: a number, text, cell reference, or expression such as ">100" or ">="&B1.
  4. Combine pairs: add as many range/criterion pairs as needed, up to the limit of the spreadsheet program (often 127 pairs in Excel).
  5. Press Enter: the formula returns the total of all matching values.

For example, with sales data in columns A (region), B (product), and C (amount), =SUMIFS(C2:C100, A2:A100, "North", B2:B100, "Widget") adds all amounts where the region is North and the product is Widget. If a row has region North but product Gadget, it is excluded.

Criteria Syntax and Wildcards

Criteria can be numbers, text, cell references, or logical expressions. Text criteria are enclosed in quotes unless referencing a cell. Comparison operators (>, <, >=, <=, <>) are placed inside quotes, and cell references are joined with an ampersand. For instance, ">"&D1 sums values greater than the number in D1.

Wildcards work in text criteria: ? matches any single character, * matches any sequence of characters, and ~ escapes a wildcard. So "A*" matches any text starting with A. Wildcards are not supported in all spreadsheet programs; Google Sheets supports them in SUMIFS as of recent versions, but behavior can vary.

  • ">=10" — greater than or equal to 10
  • "<>"&"" — not blank (often written as "<>")
  • "*east*" — contains "east" anywhere
  • "<>"&E1 — not equal to the value in E1

Dates are treated as numbers; criteria like ">="&DATE(2024,1,1) work reliably. Time values can be compared similarly.

Common Problems and Fixes

SUMIFS errors usually stem from mismatched range sizes, incorrect criteria syntax, or data type issues. If ranges are not the same size, Excel returns #VALUE!. Ensure all ranges have identical row and column counts. Text that looks like a number (e.g., "100" stored as text) will not match a numeric criterion of 100; convert the data or use a text criterion. Leading or trailing spaces also cause mismatches—use TRIM or clean the data.

Another frequent issue is criteria referencing a cell that contains an operator, such as ">"&A1 where A1 holds ">100". That would look for the literal text ">100", not a numeric comparison. Keep operators in the formula string and reference only the value. Also, SUMIFS ignores rows where the criteria range contains errors; if a criteria range has #N/A, that row is skipped, which can silently reduce totals.

Circular references can occur if the sum range overlaps a criteria range. Avoid placing the formula inside any referenced range. For large datasets, SUMIFS is generally fast, but whole-column references (e.g., A:A) can slow recalculation; use bounded ranges instead.

SUMIFS vs SUMIF and Other Functions

SUMIF handles only one condition and has the syntax SUMIF(range, criteria, [sum_range]). SUMIFS is more flexible and should be used when multiple conditions are needed. SUMIFS can replicate SUMIF by using a single pair. Note that the argument order differs: SUMIF puts the sum range last, while SUMIFS puts it first. This is a common source of errors when converting formulas.

For counting rather than summing, use COUNTIFS with the same criteria structure. For averaging, AVERAGEIFS works identically but returns the mean of matching values. SUMPRODUCT can also perform conditional sums but is less efficient and harder to read. In Google Sheets, SUMIFS behaves similarly but does not support the same wildcard escaping in all cases; check version-specific documentation.

Practical Examples

Consider a table with columns: Date (A), Salesperson (B), Region (C), Amount (D). To sum amounts for salesperson "Lee" in region "West" during January 2024:

=SUMIFS(D2:D500, B2:B500, "Lee", C2:C500, "West", A2:A500, ">="&DATE(2024,1,1), A2:A500, "<="&DATE(2024,1,31))

This uses four criteria pairs. The date criteria use two conditions on the same range—allowed because each pair is evaluated independently. The formula sums only rows where all conditions are true. If the amount column contains blanks, they are treated as zero and do not affect the total.

Another example: sum amounts greater than 500 for product codes starting with "X". Use =SUMIFS(D2:D500, E2:E500, "X*", D2:D500, ">500"). Here the sum range and a criteria range are the same column; that is valid as long as the formula is not placed within that range.

Frequently Asked Questions

Can SUMIFS use OR logic?

SUMIFS combines criteria with AND logic only. To sum with OR conditions, use multiple SUMIFS formulas added together, or use SUMPRODUCT with boolean arrays. For example, =SUMIFS(D:D, B:B, "Lee") + SUMIFS(D:D, B:B, "Kim") sums for either salesperson, but beware of double-counting if a row meets both conditions (which is impossible for a single cell, but possible with overlapping ranges).

Why does my SUMIFS return 0?

Common causes: criteria ranges are not the same size as the sum range; criteria text has extra spaces; numbers are stored as text; or the criteria syntax is wrong (e.g., missing quotes around an operator). Check each range dimension and use the Evaluate Formula tool to step through.

Does SUMIFS work with dates?

Yes. Dates are stored as serial numbers, so criteria like ">="&DATE(2024,1,1) work. Ensure the date column is formatted as dates, not text. If dates are text, convert them or use text criteria that match the format.

Can I use cell references in SUMIFS criteria?

Yes. Reference a cell directly for equality, or concatenate an operator with a cell reference: ">"&A1. Do not put the operator inside the referenced cell unless you intend a literal text match.

Is SUMIFS available in Google Sheets?

Yes, Google Sheets supports SUMIFS with the same argument order. Wildcard support and error behavior may differ slightly from Excel; consult the function documentation for details.

What is the maximum number of criteria in SUMIFS?

Excel allows up to 127 criteria range/criterion pairs. Google Sheets and other programs may have different limits, but practical formulas rarely need more than a handful.

In this article
  1. Background: Why SUMIFS Exists
  2. How SUMIFS Works Step by Step
  3. Criteria Syntax and Wildcards
  4. Common Problems and Fixes
  5. SUMIFS vs SUMIF and Other Functions
  6. Practical Examples
  7. Frequently Asked Questions