SUMIF Function in Excel: Syntax, Criteria Patterns, and Production-Grade Usage
- SUMIF sums values where a corresponding range matches a condition. Syntax: =SUMIF(criteria_range, criteria, [sum_range]). SUMIFS extends this to multiple AND conditions with reversed argument order β sum_range comes first.
- Mismatched range sizes between criteria_range and sum_range produce silently wrong results. Always verify with ROWS() and use dynamic references or Excel Tables to prevent range drift.
- Numbers stored as text, text-formatted dates, and locale-dependent date strings are the three most common causes of SUMIF returning incorrect results. Validate with ISNUMBER() and use DATE() in criteria.
- =SUMIF(criteria_range, criteria, [sum_range])
- criteria_range: the cells evaluated against the condition
- criteria: the condition (number, text, expression, or cell reference)
- sum_range: the cells to sum (defaults to criteria_range if omitted)
- Criteria with operators must be enclosed in quotes: ">100", "<>Pending"
- Text criteria are case-insensitive: "Apple" matches "apple"
- Wildcards supported: * (any characters), ? (single character)
- Blank cells as criteria use "=" (equals blank) or "<>" (not blank)
- SUMIF uses a single condition only β use SUMIFS for multiple conditions
- SUMIF silently returns 0 when criteria_range and sum_range have different sizes β no error, no warning
- Referencing entire columns (A:A, B:B) in SUMIF causes massive performance degradation in large workbooks
- Mixing data types in criteria_range (numbers stored as text) produces incorrect sums with no error
SUMIF returns 0 but matching data exists
Add helper column: =ISTEXT(A2) and =LEN(A2)-LEN(TRIM(A2))Check criteria cell: =EXACT(criteria_cell, A2) for exact match testingSUMIF total does not match manual sum
Add check: =ROWS(criteria_range) & " vs " & ROWS(sum_range)Add check: =SUM(sum_range) - SUMIF(criteria_range, criteria, sum_range) to find the deltaSUMIF extremely slow β workbook takes minutes to calculate
Ctrl+H > Find: SUMIF(*:*, replace with search to locate full-column refsFormulas > Name Manager > check for named ranges referencing full columnsSUMIF with dates returns wrong totals
Add helper: =ISNUMBER(A2) on date columnAdd helper: =TEXT(A2,"YYYY-MM-DD") to visually inspect date valuesProduction Incident
Production Debug GuideSymptom-to-action guide for the issues you will actually encounter when SUMIF produces wrong results or fails silently
SUMIF is one of the most frequently used conditional aggregation functions in Excel. It solves the core problem of summing values that meet a specific condition without manually filtering data or writing complex nested formulas.
In production environments β financial reporting, inventory tracking, sales dashboards β SUMIF appears in thousands of formulas across interconnected workbooks. Understanding its exact behavior, edge cases, and performance characteristics is critical because silent failures in SUMIF produce wrong numbers in reports, not error messages.
The most common misconceptions: SUMIF handles multiple conditions (it does not β use SUMIFS), SUMIF is case-sensitive (it is not), and SUMIF handles mismatched range sizes gracefully (it does β it just gives wrong results).
SUMIF Syntax and Basic Usage
SUMIF has three arguments: criteria_range (required), criteria (required), and sum_range (optional).
When sum_range is omitted, SUMIF sums the criteria_range itself. This is useful when the same column contains both the condition and the values β for example, summing all values greater than 100 in a single column.
When sum_range is provided, it must start at the same row as criteria_range. SUMIF pairs cells by position: the first cell in criteria_range is evaluated against criteria, and if it matches, the corresponding first cell in sum_range is added to the total.
Critical behavior: if sum_range has more rows than criteria_range, the extra rows are ignored. If criteria_range has more rows than sum_range, SUMIF references cells beyond sum_range, which can produce incorrect results or #REF! errors. Excel does not warn about this mismatch.
The criteria argument accepts several formats: - A number: 100 (matches cells equal to 100) - A cell reference: D2 (matches cells equal to the value in D2) - A comparison expression: ">100", "<=50", "<>0" (must be in quotes) - Text: "Completed", "East" (case-insensitive) - A wildcard pattern: "North", "???" (case-insensitive)
Production note: SUMIF is case-insensitive for text matching. "Apple" matches "APPLE", "apple", and "ApPlE". If you need case-sensitive matching, use SUMPRODUCT with EXACT(): =SUMPRODUCT((EXACT(A2:A100, "Apple"))*(C2:C100)).
// Basic SUMIF: sum values where region equals "East" =SUMIF(A2:A100, "East", C2:C100) // SUMIF with comparison operator: sum values greater than 1000 =SUMIF(C2:C100, ">1000") // SUMIF with cell reference as criteria =SUMIF(A2:A100, D2, C2:C100) // D2 contains the region name // SUMIF with expression in criteria (criteria in a cell) =SUMIF(C2:C100, ">"&E2) // E2 contains the threshold value // SUMIF summing the criteria_range itself (no sum_range) =SUMIF(C2:C100, ">0") // Sum all positive values in C2:C100 // SUMIF with not-equal operator =SUMIF(A2:A100, "<>Cancelled", C2:C100) // SUMIF for non-blank cells =SUMIF(A2:A100, "<>""", C2:C100) // Note: two double-quotes for not-equal-to-empty // SUMIF for blank cells =SUMIF(A2:A100, "", C2:C100)
- criteria_range[1] is evaluated. If it matches, sum_range[1] is added.
- criteria_range[2] is evaluated. If it matches, sum_range[2] is added.
- If sum_range has fewer rows, later criteria_range cells have no corresponding sum value β behavior is undefined.
- If sum_range has more rows, the extra rows are silently ignored β no error, just missing data.
- This is why mismatched range sizes produce wrong totals without any warning.
SUMIF with Wildcards and Text Patterns
SUMIF supports two wildcard characters in text criteria:
- (asterisk) β matches zero or more characters
- ? (question mark) β matches exactly one character
Wildcards work in both the criteria argument directly and when the criteria is a cell reference containing wildcard patterns.
Common patterns: - "East" β matches any text ending with "East" (e.g., "Northeast", "Southeast") - "East" β matches any text starting with "East" (e.g., "East Region", "East") - "North" β matches any text containing "North" (e.g., "Northwest", "North Central") - "???" β matches any text exactly 3 characters long - "A??le" β matches "Apple", "Aisle", etc.
Escaping wildcards: if your data contains literal asterisks or question marks, prefix with tilde (~). - "~" β matches a literal asterisk character - "~?" β matches a literal question mark - "~~*" β matches two consecutive asterisks
Production edge case: wildcard matching is case-insensitive. "apple" matches "Pineapple", "APPLE PIE", and "Crabapple". If your data contains codes like "APL-001" and "APPLICANT", a criteria of "APL*" matches both.
Performance note: wildcard criteria are significantly slower than exact-match criteria because Excel must perform string comparison for every cell in criteria_range. In workbooks with thousands of SUMIF formulas using wildcards on large ranges, calculation time can increase by 10-50x compared to exact-match SUMIF.
// Match any region containing "East" =SUMIF(A2:A100, "*East*", C2:C100) // Match product codes starting with "WDG-" =SUMIF(B2:B5000, "WDG-*", D2:D5000) // Match any 3-character department code =SUMIF(A2:A100, "???", C2:C100) // Match names starting with "Mc" (McDonald, McAllister, etc.) =SUMIF(A2:A100, "Mc*", C2:C100) // Match cells containing a literal asterisk (e.g., "5* rating") =SUMIF(A2:A100, "~*", C2:C100) // Wildcard criteria from a cell reference =SUMIF(A2:A100, D2, C2:C100) // D2 contains "*East*" // Match SKU pattern: 2 letters, dash, 4 digits =SUMIF(A2:A100, "??-????", C2:C100) // Exclude a pattern: sum all except those starting with "TEST-" =SUMIF(A2:A100, "<>TEST-*", C2:C100)
- "*" alone matches every non-empty cell β use this to sum all non-blank entries in a column.
- "*" does not match empty cells. Use "" (empty string criteria) to match blanks.
- Case-insensitivity means "abc*" matches "ABC123", "abcdef", and "AbCdEf".
- In financial data with codes (INV-001, INV-002), wildcards like "INV-*" are safe. But if you also have "INVOICE", it matches too.
- For exact matching, never use wildcards. "East" matches only "East". "East" matches "Northeast", "Southeast", and "East Coast".
SUMIFS: Multiple Conditions with AND Logic
SUMIFS extends SUMIF to handle multiple conditions with AND logic β all conditions must be true for a row to be included in the sum.
Critical syntax difference from SUMIF: - SUMIF: SUMIF(criteria_range, criteria, sum_range) β sum_range is the third argument - SUMIFS: SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) β sum_range is the FIRST argument
This argument order difference is the single most common source of errors when developers switch from SUMIF to SUMIFS. Putting sum_range in the third position (as in SUMIF) produces a #VALUE! error or, worse, silently incorrect results if the ranges happen to be valid.
SUMIFS supports up to 127 range/criteria pairs. Each additional pair adds an AND condition.
Important: SUMIFS criteria ranges do not need to be adjacent or contiguous. You can condition on column A, column D, and column F simultaneously, as long as each criteria_range has the same number of rows as sum_range.
Edge case: mixing SUMIF and SUMIFS for OR logic does not work. =SUMIFS(C:C, A:A, "East") + SUMIFS(C:C, A:A, "West") correctly implements OR on the same column. But =SUMIFS(C:C, A:A, {"East","West"}) does not work as expected in all Excel versions β it produces an array, not a scalar sum. Use SUMPRODUCT for complex OR conditions.
// SUMIFS: sum where region is "East" AND product is "Widget" =SUMIFS(C2:C100, A2:A100, "East", B2:B100, "Widget") // SUMIFS with comparison operators =SUMIFS(D2:D1000, A2:A1000, "East", D2:D1000, ">1000") // SUMIFS with date range (between two dates) =SUMIFS(C2:C100, B2:B100, ">="&DATE(2025,1,1), B2:B100, "<="&DATE(2025,1,31)) // SUMIFS with cell references for criteria =SUMIFS(C2:C100, A2:A100, E2, B2:B100, F2) // E2=region, F2=product // SUMIFS with wildcard and numeric condition =SUMIFS(C2:C100, A2:A100, "*East*", C2:C100, ">500") // OR logic on same column: sum East OR West =SUMIFS(C2:C100, A2:A100, "East") + SUMIFS(C2:C100, A2:A100, "West") // NOT condition with SUMIFS =SUMIFS(C2:C100, A2:A100, "<>Cancelled", B2:B100, "<>Refunded") // SUMIFS with blank check =SUMIFS(C2:C100, A2:A100, "East", B2:B100, "") // B is blank
- SUMIF(criteria_range, criteria, sum_range) β criteria_range comes first.
- SUMIFS(sum_range, criteria_range1, criteria1, ...) β sum_range comes first.
- Swapping them: SUMIFS(criteria_range, criteria, sum_range) returns #VALUE! if ranges are different sizes, or wrong results if they happen to be the same size.
- This is the #1 migration bug when upgrading from SUMIF to SUMIFS.
- Always verify: in SUMIFS, the first argument is always the column you are summing.
SUMIF with Dates and Date Ranges
SUMIF and SUMIFS work with date criteria, but date handling introduces several production pitfalls that cause silent wrong results.
The fundamental rule: dates in Excel are numbers (serial date numbers). January 1, 2025 is 45658. SUMIF compares the serial number against criteria. If dates are stored as text, SUMIF treats them as strings, and numeric comparison operators (>, <, >=) produce incorrect results.
Date criteria formats that work: - ">="&DATE(2025,1,1) β recommended: uses DATE() function, locale-independent - ">="&E2 β where E2 contains a date value (not text) - ">45658" β works but is unreadable and fragile
Date criteria formats that fail silently: - ">01/15/2025" β locale-dependent: 01/15 is January 15 in US but invalid in EU (day/month format) - ">Jan 15, 2025" β Excel may interpret as text, not a date comparison - Comparing against text-formatted dates β always returns 0 or wrong results
For date ranges, use SUMIFS with two conditions: =SUMIFS(values, dates, ">="&start_date, dates, "<="&end_date)
Critical edge case: date+time values. If your dates include timestamps (e.g., 01/15/2025 14:30), a criteria of "<="&DATE(2025,1,15) excludes all values with a time component after midnight (00:00). Use "<"&DATE(2025,1,16) to include all times on January 15.
// Sum values for dates on or after January 1, 2025 =SUMIFS(C2:C1000, B2:B1000, ">="&DATE(2025,1,1)) // Sum values for a specific month (January 2025) =SUMIFS(C2:C1000, B2:B1000, ">="&DATE(2025,1,1), B2:B1000, "<"&DATE(2025,2,1)) // Sum values for a date range from cell references =SUMIFS(C2:C1000, B2:B1000, ">="&E2, B2:B1000, "<="&F2) // Sum values for today's date =SUMIFS(C2:C1000, B2:B1000, TODAY()) // Sum values for last 30 days =SUMIFS(C2:C1000, B2:B1000, ">="&TODAY()-30) // Sum values for current month (dynamic) =SUMIFS(C2:C1000, B2:B1000, ">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1), B2:B1000, "<"&DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)) // Sum for a specific year =SUMIFS(C2:C1000, B2:B1000, ">="&DATE(2025,1,1), B2:B1000, "<"&DATE(2026,1,1)) // Sum for dates with time components β include full day =SUMIFS(C2:C1000, B2:B1000, ">="&DATE(2025,1,15), B2:B1000, "<"&DATE(2025,1,16))
- Check dates with ISNUMBER(): =ISNUMBER(B2). Returns FALSE for text dates.
- Check dates with CELL("format", B2): returns format code. "G" or "@" indicates text.
- Fix text dates: Data > Text to Columns > Finish (converts text to date numbers).
- External data imports (CSV, databases) frequently produce text dates. Always validate after import.
- DATE() function always returns a number. Use it in criteria instead of hardcoding date strings.
Performance Optimization for Large Workbooks
SUMIF and SUMIFS performance degrades dramatically when used with entire-column references or on large datasets. In production workbooks with thousands of formulas, unoptimized SUMIF usage can increase calculation time from seconds to minutes.
The primary performance killers:
- Entire-column references: SUMIF(A:A, criteria, B:B) scans all 1,048,576 rows even if only 1,000 contain data. Each SUMIF formula with full-column references forces Excel to evaluate over 1 million cells.
- Volatile dependencies: if criteria_range or sum_range contains volatile functions (INDIRECT, OFFSET, NOW, TODAY, RAND), Excel recalculates the SUMIF on every sheet change.
- Cross-workbook references: SUMIF referencing closed workbooks requires Excel to open the file temporarily, adding 100-500ms per formula.
- Wildcard criteria on large ranges: wildcard matching requires string comparison for every cell, which is 10-50x slower than exact-match numeric comparison.
- Overlapping SUMIF formulas: multiple SUMIF formulas scanning the same large range redundantly evaluate the same cells multiple times.
Optimization strategies: - Replace A:A with explicit ranges: A2:A10000 - Convert data to Excel Tables β structured references auto-expand and are faster - Use helper columns to pre-compute frequently used conditions - Consolidate multiple SUMIF formulas into a single SUMPRODUCT or pivot table where possible - Cache intermediate results in named ranges - For dashboards, pre-compute SUMIF results in a data model and use GETPIVOTDATA
// SLOW: entire-column reference scans 1M+ rows =SUMIF(A:A, "East", C:C) // FAST: explicit range limits scan to actual data =SUMIF(A2:A10000, "East", C2:C10000) // FASTEST: dynamic range using MATCH to find last row =SUMIF(INDIRECT("A2:A"&MATCH(REPT("z",255),A:A)), "East", INDIRECT("C2:C"&MATCH(REPT("z",255),A:A))) // Using Excel Table structured references (auto-expanding, fast) =SUMIF(Table1[Region], "East", Table1[Revenue]) // Helper column approach: pre-compute boolean condition // Helper column D: =IF(A2="East", 1, 0) =SUMPRODUCT(D2:D10000, C2:C10000) // Consolidate multiple SUMIFs into SUMPRODUCT (single pass) =SUMPRODUCT((A2:A10000="East")*(B2:B10000="Widget")*(C2:C10000)) // Named range for dynamic last-row calculation // Define name: LastRow = MATCH(REPT("z",255), Sheet1!A:A) =SUMIF(INDIRECT("A2:A"&LastRow), "East", INDIRECT("C2:C"&LastRow))
- SUMIF(A:A, criteria, B:B): 2 full-column references = 2M+ cell evaluations per formula.
- 500 formulas with full-column refs = 1 billion+ cell evaluations per recalculation.
- Replacing A:A with A2:A10000 reduces evaluations by 99% (10K vs 1M).
- Excel Tables (structured references) are the best long-term solution β they auto-expand and are optimized internally.
- INDIRECT() with MATCH() for dynamic ranges is the second-best option but INDIRECT is volatile, so it recalculates on every sheet change.
| Feature / Aspect | SUMIF | SUMIFS | SUMPRODUCT | COUNTIF |
|---|---|---|---|---|
| Primary purpose | Sum values matching one condition | Sum values matching multiple AND conditions | Sum products of arrays β flexible boolean logic | Count cells matching one condition |
| Number of conditions | 1 only | Up to 127 (AND logic) | Unlimited (AND, OR, NOT combinations) | 1 only |
| Argument order | criteria_range, criteria, [sum_range] | sum_range, criteria_range1, criteria1, ... | array1, array2, ... (multiply and sum) | range, criteria |
| OR logic support | No (must add multiple SUMIFs) | No (must add multiple SUMIFS) | Yes β use + operator between conditions | No (must add multiple COUNTIFs) |
| Case-sensitive matching | No | No | Yes β with EXACT() function | No |
| Wildcard support | Yes (* and ?) | Yes (* and ?) | Yes β with SEARCH() or FIND() | Yes (* and ?) |
| Performance (large ranges) | Fast β optimized internal engine | Fast β optimized internal engine | Slow β evaluates every cell in every array | Fast β optimized internal engine |
| Full-column reference impact | Scans 1M+ rows | Scans 1M+ rows per criteria range | Scans 1M+ rows per array β multiply impact | Scans 1M+ rows |
| Date criteria | Yes β with DATE() and comparison operators | Yes β with DATE() and comparison operators | Yes β with boolean date comparisons | Yes β with DATE() and comparison operators |
| Returns | Sum (number) | Sum (number) | Sum of products (number) | Count (number) |
| Common failure mode | Mismatched range sizes β silent wrong result | Argument order confusion β wrong result or #VALUE! | Non-numeric data in arrays β #VALUE! | Criteria format mismatch β returns 0 |
| Best for | Simple single-condition aggregation | Multi-condition aggregation with AND logic | Complex boolean logic, weighted sums, case-sensitive matching | Counting matching entries |
π― Key Takeaways
- SUMIF sums values where a corresponding range matches a condition. Syntax: =SUMIF(criteria_range, criteria, [sum_range]). SUMIFS extends this to multiple AND conditions with reversed argument order β sum_range comes first.
- Mismatched range sizes between criteria_range and sum_range produce silently wrong results. Always verify with ROWS() and use dynamic references or Excel Tables to prevent range drift.
- Numbers stored as text, text-formatted dates, and locale-dependent date strings are the three most common causes of SUMIF returning incorrect results. Validate with ISNUMBER() and use DATE() in criteria.
- Full-column references (A:A) cause severe performance degradation β each SUMIF evaluates 1M+ rows. Replace with explicit ranges or Excel Table structured references for 10-50x performance improvement.
- SUMIF is case-insensitive and uses positional pairing, not key-based matching. For case-sensitive matching, use SUMPRODUCT with EXACT(). For OR logic, add multiple SUMIF/SUMIFS formulas.
- Wildcards ( and ?) are powerful but risky. The wildcard is greedy and case-insensitive, causing silent over-matching. Always validate wildcard patterns with COUNTIF before trusting SUMIF results.
- For date criteria, always use DATE() function for locale-independent reliability. Use "<"&next_day instead of "<="&end_day to handle timestamp values correctly.
β Common Mistakes to Avoid
- βMistake 1: Mismatched criteria_range and sum_range sizes β SUMIF does not validate that both ranges have the same number of rows. If sum_range is larger, extra rows are silently ignored. If criteria_range is larger, SUMIF may reference cells beyond sum_range. Fix: always use ROWS() to verify range sizes match. Use Excel Tables or dynamic named ranges to prevent drift.
- βMistake 2: Using SUMIF argument order in SUMIFS β SUMIF is SUMIF(criteria_range, criteria, sum_range). SUMIFS is SUMIFS(sum_range, criteria_range1, criteria1, ...). Putting sum_range last in SUMIFS produces #VALUE! or silently wrong results. Fix: remember that SUMIFS starts with what you want to sum.
- βMistake 3: Numbers stored as text in criteria_range β SUMIF with ">100" on text-formatted numbers compares strings, not values. "9" is greater than "100" in string comparison because "9" > "1". Fix: convert text to numbers using Data > Text to Columns or VALUE(). Verify with ISNUMBER().
- βMistake 4: Hardcoded date strings in criteria β ">01/15/2025" is locale-dependent. In EU locale, this is invalid or interpreted as January 15 vs May 1. Fix: always use DATE() function: ">"&DATE(2025,1,15).
- βMistake 5: Using full-column references (A:A, B:B) β SUMIF(A:A, criteria, B:B) scans all 1,048,576 rows. With hundreds of formulas, this causes 30-60 second calculation times. Fix: use explicit ranges A2:A10000 or Excel Table structured references.
- βMistake 6: Expecting SUMIF to be case-sensitive β SUMIF is case-insensitive. "apple" matches "Apple", "APPLE", and "aPpLe". Fix: for case-sensitive matching, use SUMPRODUCT with EXACT(): =SUMPRODUCT((EXACT(A2:A100,"Apple"))*(C2:C100)).
- βMistake 7: Nesting SUMIF for AND logic β =SUMIF(A:A, "East", SUMIF(B:B, ">100", C:C)) does not work as expected. The inner SUMIF returns a single number, and the outer SUMIF uses criteria_range A:A against that number. Fix: use SUMIFS for multiple AND conditions.
- βMistake 8: Using wildcards unintentionally β if your data contains or ? characters (e.g., product codes like "WDG001"), SUMIF treats them as wildcards. Fix: escape with tilde: "WDG~*001".
- βMistake 9: SUMIF with date+time values and date-only criteria β =SUMIF(dates, "<="&DATE(2025,1,15), values) excludes any dates with a time component after midnight on Jan 15. Fix: use "<"&DATE(2025,1,16) to include all times on Jan 15.
- βMistake 10: Not validating SUMIF results β SUMIF returns a number even when the result is wrong due to mismatched ranges, text-formatted numbers, or incorrect criteria. Fix: add validation formulas (SUM of sum_range, COUNTIF with same criteria) to cross-check SUMIF totals.
Interview Questions on This Topic
- QExplain the difference between SUMIF and SUMIFS. Why does the argument order differ, and what happens if you use SUMIF argument order in a SUMIFS formula?
- QA SUMIF formula returns 0 but you know matching data exists in the range. What are the three most likely causes, and how would you diagnose each?
- QHow does SUMIF handle mismatched range sizes between criteria_range and sum_range? What are the production consequences of this behavior?
- QYou need to sum values where the region is "East" OR "West". Write the formula using SUMIFS and explain why you cannot use a single SUMIFS for OR logic on the same column.
- QExplain why SUMIF(A:A, criteria, B:B) causes performance problems in large workbooks. What are three alternatives?
- QA CSV import produces dates as text strings. Your SUMIFS formula with DATE() criteria returns $0 for all date ranges. Explain the root cause and the fix.
- QHow would you implement case-sensitive SUMIF? Why does SUMIF not support this natively?
- QWrite a SUMIFS formula that sums revenue for the current month dynamically (updates automatically as dates change).
- QA workbook has 2,000 SUMIF formulas all scanning the same 100,000-row dataset. What optimization strategies would you apply, and what is the expected performance improvement?
- QExplain the wildcard behavior of * and ? in SUMIF. What is the production risk of using wildcards, and how would you validate that a wildcard pattern matches only the intended cells?
Frequently Asked Questions
What is the difference between SUMIF and SUMIFS?
SUMIF handles a single condition. SUMIFS handles multiple AND conditions (up to 127). The critical difference is argument order: SUMIF is SUMIF(criteria_range, criteria, [sum_range]) while SUMIFS is SUMIFS(sum_range, criteria_range1, criteria1, ...). In SUMIFS, sum_range is the first argument. Using SUMIF argument order in SUMIFS produces #VALUE! errors or silently wrong results.
Why does my SUMIF return 0 when I know matching data exists?
The three most common causes are: (1) numbers stored as text in criteria_range β verify with ISNUMBER() and convert using VALUE() or Text to Columns; (2) leading or trailing spaces in criteria or criteria_range β use TRIM() on both; (3) criteria format mismatch β if criteria uses comparison operators (>, <), the values must be numbers, not text.
Can SUMIF handle multiple conditions?
No. SUMIF handles only one condition. For multiple AND conditions, use SUMIFS. For OR conditions on the same column, add multiple SUMIFS formulas: =SUMIFS(C:C, A:A, "East") + SUMIFS(C:C, A:A, "West"). For complex boolean logic (AND + OR combinations), use SUMPRODUCT.
How do I use SUMIF with a date range?
Use SUMIFS with two date conditions: =SUMIFS(values, dates, ">="&DATE(2025,1,1), dates, "<"&DATE(2025,2,1)). Always use the DATE() function for locale-independent criteria. Use "<"&next_day (not "<="&end_day) to include all timestamps on the end date.
Why is my SUMIF so slow?
The most likely cause is full-column references (A:A, B:B). Each full-column SUMIF evaluates all 1,048,576 rows. Replace with explicit ranges (A2:A10000) or convert data to an Excel Table and use structured references. Other causes: wildcard criteria on large ranges, cross-workbook references, and volatile functions (INDIRECT, OFFSET) in criteria.
How do I make SUMIF case-sensitive?
SUMIF is always case-insensitive. For case-sensitive matching, use SUMPRODUCT with EXACT(): =SUMPRODUCT((EXACT(A2:A100, "Apple"))*(C2:C100)). This multiplies a boolean array (1 where EXACT matches) by the values array and sums the products.
What happens if criteria_range and sum_range are different sizes?
SUMIF does not validate range sizes. If sum_range is larger, extra rows are silently ignored. If criteria_range is larger, SUMIF may reference cells beyond sum_range, producing incorrect values or #REF! errors. No warning is given. Always verify range sizes with ROWS() on both ranges.
Can I use SUMIF across different sheets or workbooks?
Yes. For same-workbook different sheets: =SUMIF(Sheet2!A2:A100, criteria, Sheet2!C2:C100). For closed workbooks, include the full file path: =SUMIF('[Source.xlsx]Sheet1'!A2:A100, criteria, '[Source.xlsx]Sheet1'!C2:C100). Cross-workbook SUMIF is significantly slower because Excel must open the source file for each calculation.
Developer and founder of TheCodeForge. I built this site because I was tired of tutorials that explain what to type without explaining why it works. Every article here is written to make concepts actually click.