SUMIF adds cells that meet one criterion
=SUMIF(range, criteria, [sum_range]) adds the values that meet one criterion. =SUMIF(A2:A10, "North", B2:B10) sums column B on the rows where column A is North. If nothing matches, the result is 0.
=SUMIF(range, criteria, [sum_range])The SUMIF formula in Excel is =SUMIF(range, criteria, [sum_range]). It adds numbers for the rows that meet one condition. =SUMIF(A2:A10, "North", B2:B10) sums B2:B10 where A2:A10 equals North. If you omit sum_range, Excel adds the cells in range that meet the criterion. If no cell matches, SUMIF returns 0. Text criteria are not case-sensitive. "North" and "north" match the same cells. * matches any sequence of characters and ? matches one character. A literal * or ? is written with a tilde, as in "~*". SUMIF does not accept a second condition. Several conditions belong in SUMIFS. sum_range does not have to be the same size as range: Excel starts at the top-left cell of sum_range and uses the height and width of range. Text in sum_range is ignored. An error in a cell that would be added is returned as the result.
Syntax & Parameters
The SUMIF formula follows a straightforward three-parameter structure: =SUMIF(range, criteria, [sum_range]). Understanding each parameter is crucial for successful implementation. The first parameter, 'range', is required and specifies which cells Excel will evaluate against your criteria. This range contains the values that determine whether each row qualifies for inclusion in the sum. For example, if you're summing sales by region, the range would be your region column. The second parameter, 'criteria', is also required and defines the condition that must be met. Criteria can be a number (e.g., 100), text (e.g., "North"), or an expression (e.g., ">50"). When using text criteria, Excel performs case-insensitive matching, meaning "SALES" and "sales" are treated identically. The optional third parameter, 'sum_range', specifies which cells to actually sum. If omitted, Excel sums the cells in the original range. This parameter is essential when your criteria column differs from your sum column, for instance, evaluating a region column while summing a revenue column. Without sum_range specified, Excel would attempt to sum the region names, producing an error. Practical tip: Always ensure your range and sum_range have identical dimensions. A range of A1:A100 should pair with a sum_range of B1:B100, not B1:B50, to avoid unexpected results.
rangecriteriasum_rangePractical Examples
Sales Analysis by Region
=SUMIF(A2:A101,"North",B2:B101)This formula evaluates each cell in the region column (A2:A101) for the text 'North'. When a match is found, the corresponding value in the sales column (B2:B101) is added to the total. If the dataset contains 25 'North' entries with various sales amounts, all matching sales are summed together.
Conditional Inventory Valuation
=SUMIF(C:C,"Electronics",D:D)Using entire columns (C:C and D:D) instead of specific ranges makes this formula dynamic, new data automatically includes in calculations without formula adjustment. Excel evaluates every cell in column C, and when 'Electronics' is found, the corresponding value from column D is included in the sum.
Performance Bonus Calculation with Numeric Criteria
=SUMIF(E2:E500,">85",F2:F500)This example demonstrates numeric criteria using a comparison operator. The formula searches for all performance scores exceeding 85 and sums the corresponding bonus amounts. Operators like >, <, >=, <=, <>, and = enable flexible conditional logic beyond simple text or value matching.
Key Takeaways
- SUMIF evaluates one range against criteria and sums corresponding values from another range, making it essential for conditional calculations.
- The formula syntax =SUMIF(range, criteria, [sum_range]) requires careful attention to parameter matching and data type consistency.
- Text criteria are case-insensitive and support wildcards (* and ?), while numeric criteria support comparison operators (>, <, >=, <=, <>, =).
- For multiple criteria scenarios, use SUMIFS instead of SUMIF to avoid complex nested formulas and improve readability.
- Dynamic criteria using cell references and functions like TODAY enable flexible, self-updating reports that adapt to changing business needs.
Pro Tips
Use entire column references (A:A instead of A1:A1000) to create future-proof formulas. New data automatically includes without formula adjustment, reducing maintenance overhead.
Impact : Saves time updating formulas when datasets grow and ensures no data is accidentally excluded from calculations.
Combine SUMIF with IFERROR to handle missing data gracefully: =IFERROR(SUMIF(A:A,"North",B:B),0). This prevents #REF! or #VALUE! errors from disrupting reports.
Impact : Creates robust spreadsheets that continue functioning even when source data is incomplete or references become invalid.
Use cell references for criteria instead of hardcoding values: =SUMIF(A:A,B1,C:C). This allows changing criteria in B1 without editing the formula, enabling flexible dashboard functionality.
Impact : Transforms static formulas into dynamic tools that non-technical users can operate by simply changing cell values.
When working with dates, use DATE function for clarity: =SUMIF(A:A,">="&DATE(2026,1,1),B:B). This is more readable than numeric date codes and reduces errors.
Impact : Improves formula maintainability and reduces mistakes when working with date-based criteria across different regional date formats.
Useful Combinations
SUMIF with IF for Conditional Display
=IF(SUMIF(A:A,"North",B:B)>10000,"High Sales","Low Sales")Combines SUMIF with IF to display conditional messages based on sum results. If North region sales exceed 10,000, displays 'High Sales'; otherwise shows 'Low Sales'. Useful for dashboard indicators and automated reporting.
SUMIF with TODAY for Time-Based Analysis
=SUMIF(A:A,">="&TODAY()-30,B:B)Sums values where dates in column A fall within the last 30 days. Combines SUMIF with TODAY function to create dynamic date-based criteria. Automatically adjusts daily without manual formula updates, perfect for rolling period analysis.
Nested SUMIF for Multiple Condition Scenarios
=SUMIF(A:A,"North",B:B)+SUMIF(A:A,"South",B:B)Combines multiple SUMIF functions to sum across several criteria categories. This approach adds sales from both North and South regions. While SUMIFS is more efficient for complex scenarios, nested SUMIF works when criteria are in the same column with different values.
Common Errors
Cause: The criteria expression is invalid, or a cell that SUMIF would add contains an error. Text in sum_range does not cause #VALUE!. SUMIF skips that text. =SUMIF(A:A, ">"&B1, C:C) returns the error from B1 when B1 itself contains an error.
Solution: Put text criteria in quotes and join a comparison with &: =SUMIF(A:A, ">"&B1, C:C). Fix error values in the cells being added. Leave ordinary text in sum_range. SUMIF does not add it.
Cause: This reference error appears when the formula references deleted cells or invalid ranges. For instance, if you reference columns that have been deleted, or if sum_range references cells outside the worksheet's valid area.
Solution: Verify all range references exist in your worksheet. Check that column letters and row numbers are correct. If ranges were deleted, use the undo function or manually correct the formula references. Avoid using invalid ranges like A1:Z1000000 that exceed worksheet dimensions.
Cause: Excel displays this error when the formula contains unrecognized text, typically a misspelled function name. For example, =SUMIF vs =SUMIFF, or using a function name in a different language than your Excel installation expects.
Solution: Verify the formula spelling is exactly 'SUMIF' with no extra characters. Check that your Excel language settings match the formula syntax. Use the function wizard (fx button) to ensure proper syntax. Copy working formulas from reliable sources rather than typing from memory.
Troubleshooting guides for SUMIF
Troubleshooting Checklist
- 1.sum_range does not have to be the same size as range. Excel starts at the top-left cell of sum_range and uses the size of range, so a shorter sum_range still reaches cells outside the address you typed.
- 2.Text in sum_range is ignored. It does not cause #VALUE!. An error value in a cell that is added is returned as the result.
- 3.Check criteria syntax: text must be in quotes ("North"), numbers don't need quotes (100), and operators must be valid (>, <, >=, <=, <>, =).
- 4.Ensure no extra spaces in criteria text. "North" and "North " (with trailing space) are treated as different values.
- 5.Verify worksheet references are correct for multi-sheet formulas. Use SheetName!Range format and confirm sheet names have no spaces or special characters.
- 6.Test with a smaller dataset first. Create a simple SUMIF in a new area to verify basic functionality before applying to complex data.
Edge Cases
Criteria contains * or ?
Behavior: SUMIF treats * and ? as wildcards, and ~ as the escape character. The criterion "*100*" matches any text that contains 100, including 1*100. To match a literal asterisk, write "~*".
Solution: Use SUMPRODUCT with EXACT for literal character matching: =SUMPRODUCT((EXACT(A:A,"*100*"))*(B:B)). This treats all characters literally without wildcard interpretation.
Most users encounter this when searching for product codes or filenames containing asterisks.
Sum_range contains blank cells or errors
Behavior: Blank cells in sum_range add nothing. An error such as #N/A or #DIV/0! in a cell that meets the criterion is not skipped: SUMIF returns that error.
Solution: Fix the error in the source cell, or exclude that row with a criterion that does not select it.
SUMIF returns the error from a selected cell. It does not drop that cell and continue the sum.
Criteria range contains merged cells
Behavior: A merged range stores its value in the top-left cell. The other cells of the merge are empty, so SUMIF sees the criterion only on that top-left cell.
Solution: Avoid merged cells in criteria ranges. If merging is necessary, unmerge for SUMIF calculations and remerge for display. Alternatively, use helper columns with unmerged cells for SUMIF logic.
This limitation stems from Excel's internal handling of merged cells and is best addressed through data structure design rather than formula workarounds.
Limitations
- •SUMIF evaluates only single criteria. Complex multi-criteria scenarios require SUMIFS, nested SUMIF functions, or SUMPRODUCT, each with different performance characteristics and complexity levels.
- •Performance degrades with extremely large datasets (>100,000 rows) when using entire column references (A:A). Specify exact ranges (A1:A100000) for better performance in large workbooks.
- •Criteria matching is case-insensitive for text, making case-sensitive comparisons impossible without alternative functions like SUMPRODUCT combined with EXACT.
- •SUMIF cannot directly sum based on formula results or complex conditions involving multiple columns with AND/OR logic. These scenarios require SUMIFS, SUMPRODUCT, or helper columns.
Alternatives
SUMIFS handles multiple criteria simultaneously, eliminating the need for nested formulas or helper columns. Use this when evaluating multiple conditions across different columns.
When: Sum sales where region='North' AND product='Widget' AND amount>1000. Syntax: =SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2, ...)
SUMPRODUCT offers maximum flexibility for complex conditions, including case-sensitive matching, array operations, and custom logic. It works across all Excel versions without limitations.
When: Sum values with complex conditions like =SUMPRODUCT((A:A>100)*(B:B<200)*(C:C)) or case-sensitive text matching using EXACT function.
For large datasets requiring frequent summarization by multiple dimensions, Pivot Tables provide interactive analysis without formulas. They automatically update and allow quick filtering.
When: Analyze sales by region, product, and time period with automatic subtotals. Better than SUMIF for exploratory analysis and presentation-ready reports.
Compatibility
✓ Excel
Since 2007
=SUMIF(range, criteria, [sum_range]) - Identical syntax across all versions from Excel 2007 through Excel 365. No breaking changes or version-specific limitations.✓Google Sheets
=SUMIF(range, criterion, [sum_range]) - Google Sheets uses 'criterion' (singular) in documentation but accepts both singular and plural forms. Syntax is functionally identical to Excel.Google Sheets SUMIF performs identically to Excel. Criteria wildcards work the same way. Multi-sheet references use SheetName!Range format. Cross-file references use IMPORTRANGE combined with SUMIF.
✓LibreOffice
=SUMIF(Range, Criteria, [SumRange]) - LibreOffice Calc supports identical syntax. Function names and parameters match Excel precisely.Frequently Asked Questions
Explore Math and Trigonometry
Related Formulas
Use Cases with this Formula
Sales tracking spreadsheet for sales reps
Calculate sales commissions in Excel
Excel sales pipeline
Cash flow statement for accountants
Manage expense reports in Excel
Monthly accounting report
Free Tools Using this Formula
Excel Formula Generator
Describe the calculation in plain English. This free Excel formula generator returns a formula you can copy into the sheet.
Excel Formula Explainer
Paste an Excel formula that starts with =. This free tool explains what the formula is doing, in plain language.
Excel Function Translator
Translate Excel function names between 6 languages: English, French, Spanish, German, Italian, Portuguese.