Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel SUMIFS: Sum Values in a Table Based on Criteria

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To sum values in an Excel table based on criteria, use the SUMIFS function (or its single-condition sibling SUMIF). SUMIFS adds up numbers in a sum range only when matching rows meet every condition you set across one or more criteria ranges. The formula is =SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...). If you are on an older Excel version without SUMIFS, use SUMIF for one condition only. The steps below assume a properly formatted Excel table (created with Insert > Table or Ctrl+T) or a plain range with headers; labels can differ slightly by Excel version and platform, but the function names and syntax are the same on Windows, Mac, and Excel for the web.

What You'll Need

  • Excel 2007 or later (SUMIFS was introduced in Excel 2007; SUMIF works in all versions). Excel for the web, Mac, and mobile also support SUMIFS.
  • A table or range with at least one column of numbers to sum and at least one column of criteria values (text, dates, or numbers).
  • Column headers that are unique and in the first row of the table or range.
  • Consistent data types in criteria columns: no numbers stored as text, no trailing spaces in text values, and real Excel dates rather than text dates.

Step-by-Step

  1. Confirm your data is in a table. Select any cell in the data and press Ctrl+T (Windows) or Command+T (Mac). In the Create Table dialog, tick “My table has headers” and click OK. If you prefer a plain range, just ensure headers are in row 1 and there are no blank rows inside the data. Tables are safer because structured references adjust when rows are added.
  2. Identify the sum range. This is the column of numbers you want to add. For example, if column D is “Amount,” the sum range is D2:D100 (or the table column Table1[Amount]).
  3. Identify each criteria range and its condition. For a single condition, pick the column to test (for example, B2:B100 for “Region”) and the value to match (for example, “North”). For multiple conditions, repeat: criteria_range2 and criteria2, and so on.
  4. Write the SUMIFS formula in an empty cell. The order is always sum_range first, then pairs of criteria_range and criteria. Example: =SUMIFS(D2:D100, B2:B100, "North"). With two conditions: =SUMIFS(D2:D100, B2:B100, "North", C2:C100, "Paid"). If you are using a table, structured references work: =SUMIFS(Table1[Amount], Table1[Region], "North", Table1[Status], "Paid").
  5. Use cell references for criteria when you want to change them easily. Put “North” in cell G1 and “Paid” in G2, then write =SUMIFS(D2:D100, B2:B100, G1, C2:C100, G2). This avoids editing the formula each time.
  6. Add wildcards for partial text matches. Use * for any number of characters and ? for one character. For example, "North*" matches North, Northeast, Northwest. To match a literal asterisk or question mark, precede it with a tilde: "~*".
  7. Use comparison operators for numbers and dates. Enclose the operator and value in quotes: ">=100", "<500", ">="&DATE(2024,1,1). For a cell reference, concatenate: ">="&H1. This sums values greater than or equal to the date or number in H1.
  8. Press Enter and verify the result. Compare against a manual filter: filter the table by the same criteria and check the status bar sum (select the number column after filtering; Excel shows Sum in the status bar). If the numbers differ, check for text-formatted numbers, extra spaces, or dates stored as text.
  9. Copy the formula down or across if needed. Use absolute references (for example, $D$2:$D$100) for ranges that should not shift, and relative references for criteria cells you want to change per row.

Common Mistakes

  • Reversing the argument order. SUMIFS starts with sum_range; SUMIF starts with criteria_range. Mixing them returns wrong totals or errors.
  • Mismatched range sizes. All criteria ranges must be the same size as the sum range. If D2:D100 is the sum range, B2:B100 and C2:C100 must also be 99 rows. Otherwise Excel returns #VALUE!.
  • Numbers stored as text. A column that looks numeric but is left-aligned will not sum correctly. Convert with Text to Columns or multiply by 1 in a helper column, then re-copy values.
  • Trailing spaces in criteria. “North ” does not match “North”. Use TRIM on the source data or clean the criteria cell.
  • Dates as text. If dates are stored as text, comparisons like ">="&DATE(2024,1,1) fail. Convert to real dates with Date > Text to Columns or DATEVALUE.
  • Forgetting quotes around text criteria. SUMIFS(D2:D100, B2:B100, North) returns #NAME? because North is treated as a name. Use "North".

Tips

  • Use a table (Ctrl+T) so ranges expand automatically when you add rows; structured references like Table1[Amount] stay correct.
  • Name key ranges (Formulas > Define Name) to make formulas readable, for example =SUMIFS(Amount, Region, "North").
  • For multiple criteria on the same column (for example, North or South), use SUMIFS twice and add: =SUMIFS(D2:D100,B2:B100,"North")+SUMIFS(D2:D100,B2:B100,"South"). SUMIFS treats multiple criteria as AND, not OR.
  • Use & to combine operators with cell references: ">"&G1.
  • If you need a quick total without formulas, insert a PivotTable (Insert > PivotTable) and drag the criteria field to Rows and the number field to Values; set the value field to Sum.

Troubleshooting

  • #VALUE! error: range sizes differ. Check that every criteria range has the same number of rows and columns as the sum range.
  • #NAME? error: a text criterion is missing quotes, or a function name is misspelled. Also check that named ranges exist.
  • Result is 0 when you expect a total: criteria do not match exactly. Check for extra spaces, case differences (SUMIFS is not case-sensitive, so case is not the issue), numbers stored as text, or dates stored as text. Use =COUNTIFS(...) with the same criteria to see how many rows match; if it returns 0, the criteria are the problem.
  • Result is too high: a criteria range is offset from the sum range (for example, sum range starts at row 2 but criteria range starts at row 1). Align the starting rows.
  • Formula works in one cell but not when copied: relative references shifted. Lock ranges with $ (for example, $D$2:$D$100) before copying.
  • Wildcards not working: check that the cell contains text, not a number, and that you used * or ? correctly. To match a literal wildcard character, prefix it with ~.

Frequently Asked Questions

What is the difference between SUMIF and SUMIFS?

SUMIF handles one condition and takes the criteria range first: =SUMIF(B2:B100, "North", D2:D100). SUMIFS handles one or more conditions and takes the sum range first: =SUMIFS(D2:D100, B2:B100, "North"). Use SUMIFS for anything beyond a single condition.

Can SUMIFS use OR logic?

Not directly. SUMIFS combines multiple criteria with AND. For OR, add separate SUMIFS formulas or use SUMPRODUCT with Boolean arrays. A simple OR for two values in the same column: =SUMIFS(D2:D100,B2:B100,"North")+SUMIFS(D2:D100,B2:B100,"South").

How do I sum between two dates?

Use two criteria on the same date column: =SUMIFS(D2:D100, A2:A100, ">="&DATE(2024,1,1), A2:A100, "<="&DATE(2024,12,31)). Ensure the date column contains real dates, not text.

Why does my SUMIFS return 0 for text criteria that look correct?

Usually trailing spaces, non-breaking spaces, or numbers stored as text. Clean the source with TRIM and CLEAN, or use wildcards around the criterion: "*North*". Also confirm the criteria range and sum range start on the same row.

Does SUMIFS work with Excel tables and structured references?

Yes. Use the table name and column headers in brackets, for example =SUMIFS(Table1[Amount], Table1[Region], "North"). Structured references update automatically when the table grows.

Can I sum a filtered table only?

SUMIFS does not respect filters; it evaluates all rows. To sum only visible rows, use SUBTOTAL with function number 109 on the number column, or use AGGREGATE. Alternatively, use a PivotTable with a filter.