SUMIF Function Guide
Master the SUMIF function with practical examples and error solutions. Learn how to sum cells based on criteria with step-by-step tutorials.



=SUMIF(range, criteria, [sum_range])
Practical Examples
Basic Sales Summation
Calculate total sales for the East region
Threshold-Based Calculation
Sum all sales transactions over $10,000
Wildcard Pattern Matching
Sum sales for all products starting with 'Pro'
Date-Based Aggregation
Calculate total revenue for Q1 2024 orders
Dynamic Cell Reference Criteria
Sum budgets for departments matching a user-selected value
Negative Value Exclusion
Sum only positive inventory adjustments
Cross-Sheet Reference with Named Ranges
Sum project costs for high-priority projects across sheets
Common Errors and Solutions
SUMIF returns #VALUE! error
The criteria argument contains an invalid expression or the range and sum_range have incompatible sizes
1. Check that text criteria are enclosed in quotes: Use ">=100" not >=100 2. Verify range and sum_range have the same dimensions 3. Ensure date criteria are properly formatted 4. Use IFERROR wrapper for graceful error handling
Example:
Excel doesn't recognize the function name
Misspelled function name, missing quotes around text criteria, or using SUMIF in a version that doesn't support it
1. Check spelling: SUMIF not SUMIIF or SUM IF 2. Ensure text criteria use straight quotes (") not curly quotes 3. Verify Excel version supports SUMIF (Excel 97+) 4. Check regional settings for function names
Use Excel's autocomplete feature when typing formulas to avoid typos
SUMIF returns 0 when data exists
Criteria doesn't match any cells due to data type mismatch, extra spaces, or case sensitivity in numbers stored as text
1. Check for leading/trailing spaces: Use TRIM() on your data 2. Verify numbers aren't stored as text: Use VALUE() to convert 3. Test with wildcard criteria to diagnose: "*text*" 4. Use exact match criteria first to isolate issues
Example:
Invalid cell reference error
Deleted rows/columns that were referenced in the formula, or moving formula to a location where references become invalid
1. Use absolute references for ranges: $A$2:$A$10 2. Employ named ranges for better stability 3. Rebuild formula with current valid references 4. Use INDIRECT for dynamic but stable references
Always use absolute references or named ranges for SUMIF formulas that will be copied
Advanced Tips and Best Practices
For datasets over 10,000 rows, limit range references instead of using entire columns. Use A2:A10000 rather than A:A to improve calculation speed by 60-70%. Sort your data by the criteria column when possible, as Excel can optimize internally for sorted data.
In Excel 365, combine SUMIF with UNIQUE for powerful dynamic reports: =SUMIF(A:A, UNIQUE(A:A), B:B) creates a summary table automatically. This spills results vertically, updating automatically when source data changes.
SUMIF includes hidden and filtered rows in calculations. Use AGGREGATE or SUBTOTAL functions if you need to sum only visible cells. This is a common source of confusion when working with filtered datasets.
For OR logic with multiple criteria, add SUMIF functions: =SUMIF(A:A,"Apple",B:B)+SUMIF(A:A,"Orange",B:B). For AND logic with multiple columns, upgrade to SUMIFS which handles multiple criteria natively.
Always wrap SUMIF in IFERROR for production spreadsheets: =IFERROR(SUMIF(range, criteria, sum_range), 0) or use a descriptive message like 'No matches found'. This prevents errors from cascading through dependent calculations.
Need Help with SUMIF Function Guide?
Stop struggling with formula syntax. Use AskFormulas to generate validated formulas instantly with our AI-powered tool.
Example Excel formula:
Related Formulas
Master the COUNTIF function to count cells that meet specific criteria. Learn syntax, practical examples, and error solutions for data analysis.

Master COUNTIFS to count cells with multiple criteria. Learn syntax, see real examples, and solve errors for powerful multi-condition data analysis.

Master the SUM function with practical examples and error solutions. Learn how to add numbers, ranges, and multiple criteria efficiently.

Master SUMIFS to sum cells meeting multiple criteria. Learn conditional summation with practical examples and error solutions in Excel & Google Sheets.
