The direct answer: Excel has no single SUMIF function that accepts two criteria, but you can sum with two criteria using SUMIFS (the modern, recommended way), or by combining two SUMIF functions with addition, or by using SUMPRODUCT for more complex logic. For example, to sum sales in column C where column A equals “North” and column B equals “Widgets”, use =SUMIFS(C2:C100, A2:A100, "North", B2:B100, "Widgets").
Why SUMIF Only Handles One Criterion
The original SUMIF function, available since early Excel versions, was designed for a single condition: =SUMIF(range, criteria, [sum_range]). It sums the values in sum_range where the corresponding cells in range match the criteria. Because it accepts only one condition range and one criteria, you cannot directly pass a second pair. Microsoft introduced SUMIFS in Excel 2007 specifically to address this limitation, allowing multiple criteria pairs in a single formula. If you are using Excel 2007 or later (including Microsoft 365, Excel 2021, 2019, 2016, etc.), SUMIFS is the standard tool.
Using SUMIFS for Two or More Criteria
SUMIFS has a different argument order than SUMIF: the sum range comes first, then each criteria range and its matching criteria. Syntax: =SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...).
Example: Assume you have a table with:
• A2:A100 = Region
• B2:B100 = Product
• C2:C100 = Sales amount
To sum sales where Region is “East” and Product is “Gadget”, enter:=SUMIFS(C2:C100, A2:A100, "East", B2:B100, "Gadget")
This returns the total of all C values where A is “East” and B is “Gadget”. If you had 5 rows meeting both conditions with sales 10, 20, 30, 40, 50, the result is 150.
You can add more criteria pairs (up to 127 in modern Excel). The criteria can be numbers, text, cell references, or expressions like “>100” or “*Widget*”. For text criteria, use quotes; for cell references, omit quotes: =SUMIFS(C2:C100, A2:A100, E1, B2:B100, F1) where E1 and F1 hold the criteria.
Combining Two SUMIF Functions (When You Must)
If you are on an older Excel version (2003 or earlier) or you need to sum with an OR logic (e.g., Region is “East” OR “West”), you can add two SUMIF results. For AND logic, adding two SUMIFs would double-count rows that meet both conditions, so only use this for mutually exclusive criteria.
Example for OR logic: sum sales where Region is “East” or “West” (assuming no row has both):=SUMIF(A2:A100, "East", C2:C100) + SUMIF(A2:A100, "West", C2:C100)
This adds the two separate sums. For AND logic with two different columns, you cannot simply add two SUMIFs because a row meeting both criteria would be counted twice. Use SUMIFS instead.
Using SUMPRODUCT for Flexible Two-Criteria Sums
SUMPRODUCT is an older function that can handle multiple conditions without needing SUMIFS. It multiplies arrays and sums the results. For two criteria, you can write:=SUMPRODUCT((A2:A100="East")*(B2:B100="Gadget")*C2:C100)
This works by converting TRUE/FALSE to 1/0, multiplying them together (1 only when both conditions are true), then multiplying by the sales values and summing. The result is the same as the SUMIFS example. SUMPRODUCT is useful when you need to apply more complex logic, such as OR conditions within the same column: =SUMPRODUCT(((A2:A100="East")+(A2:A100="West"))*(B2:B100="Gadget")*C2:C100) – note the plus sign for OR. However, SUMPRODUCT can be slower on very large datasets (over 100,000 rows) and requires careful use of parentheses.
How to Choose Between SUMIFS and SUMPRODUCT
- Use SUMIFS as your default: it is faster, easier to read, and the standard for multiple criteria. It supports wildcards (*, ?) and comparison operators.
- Use SUMPRODUCT when you need OR logic across the same column, or when you must perform array-like calculations that SUMIFS cannot do (e.g., summing based on a calculated condition like
(A2:A100*B2:B100)>100). - Use two SUMIFs only if you are on a legacy version without SUMIFS, or if you are summing with OR and the categories are mutually exclusive.
Common Problems and Fixes
- Wrong argument order in SUMIFS: The sum range must come first. If you swap it, you get a #VALUE! error or wrong results. Double-check the order.
- Criteria with text and wildcards: To match text that contains a substring, use asterisks:
"*Gadget*". To match a question mark or asterisk literally, precede it with a tilde (~). - Criteria referencing a cell with a comparison operator: If you want to sum values greater than a number in cell D1, you need to concatenate:
=SUMIFS(C2:C100, C2:C100, ">"&D1)– note the ampersand. - Blank or zero cells: SUMIFS ignores blank cells in the sum range, but if a criteria range contains blanks, you can use
""to match blanks or"<>"to match non-blanks. - Case sensitivity: SUMIFS and SUMIF are not case-sensitive. If you need case-sensitive matching, use SUMPRODUCT with EXACT:
=SUMPRODUCT((EXACT(A2:A100,"East"))*C2:C100).
Frequently Asked Questions
Can I use SUMIF with two criteria in the same column?
Yes, but not directly. To sum values where the same column meets either of two criteria (OR), use =SUMIF(range, "crit1", sum_range) + SUMIF(range, "crit2", sum_range). To sum where the same column meets both criteria (impossible for a single cell), you would need two different columns. For an AND condition across two columns, use SUMIFS.
What is the difference between SUMIF and SUMIFS?
SUMIF takes one criteria range and one criteria, with the sum range as an optional third argument. SUMIFS takes the sum range first, then multiple pairs of criteria ranges and criteria. SUMIFS is available in Excel 2007 and later; SUMIF is available in all versions. For a single criterion, both work, but SUMIFS is more consistent if you later add more criteria.
How do I sum with two criteria where one is a date range?
Use SUMIFS with two criteria on the same date column: one for the start date and one for the end date. For example, with dates in A2:A100 and sales in B2:B100, to sum between Jan 1, 2025 and Jan 31, 2025: =SUMIFS(B2:B100, A2:A100, ">="&DATE(2025,1,1), A2:A100, "<="&DATE(2025,1,31)). Ensure the dates are real Excel dates, not text.
Why is my SUMIFS returning 0 even though there are matches?
Common causes: (1) The criteria range and sum range are not the same size – they must be identical in dimensions. (2) The criteria text has extra spaces or is in a different case (though case is ignored, spaces are not). (3) The criteria are numbers stored as text – use VALUE() or ensure the criteria cell is numeric. (4) You used a comparison operator without concatenation, e.g., ">100" is fine, but referencing a cell requires ">"&D1.
Can I use wildcards in SUMIFS criteria?
Yes, for text criteria you can use an asterisk (*) to match any sequence of characters and a question mark (?) to match any single character. For example, "*Widget*" matches any cell containing "Widget". To match a literal asterisk, use "~*". Wildcards do not work with numeric criteria.
Is there a way to sum with two criteria using a pivot table?
Yes, a PivotTable is an excellent alternative for summing with multiple criteria without writing formulas. Drag the fields you want to filter into the Filters area (or Slicers), and the Values field to Sum. This is often easier for ad-hoc analysis, but it does not update automatically when data changes unless you refresh. For a formula-based approach that updates automatically, SUMIFS is better.
Related
- Shortcut for Print: Fastest Ways in Windows & Mac
- Data Entry Pay: Hourly Rates & Salaries in 2024
- COUNTIF Formula in Google Sheets: How to Use It
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Can You Filter by Bold Text in Excel?No—not directly. Excel for Microsoft 365 on Windows can filter a range by values, cell color, font color,…
- C++ String Manipulation Functions ExplainedThe most common string manipulation functions in C++ come from the std::string class (in <string>) and include length(),…
- How to Filter in Excel Without a Mouse: Keyboard GuideTo filter a list in Excel for Microsoft 365 on Windows without a mouse, select a cell in…
- Excel Function to Lowercase? Use LOWERThe Excel function to convert text to lowercase is LOWER. For example, =LOWER("HELLO") returns hello, and you can…
- WEEKDAY Function in Excel: Find the Day of the WeekExcel’s WEEKDAY function returns a number for the day of the week represented by a date. If cell…
- Sort Excel Rows by Column Value: A Practical GuideTo sort rows in Excel by a column value, click a cell in the data, then choose Data…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.