How to Use SUMIF in Excel
SUMIF is Excel's conditional summing workhorse. It adds up values that meet a specific criterion, eliminating the need to filter data manually or create helper columns. If you've ever found yourself...
Key Insights
- SUMIF combines filtering and summing in one formula—use it when you need totals based on a single condition instead of manually filtering data
- The
sum_rangeparameter is optional; when omitted, Excel sums the same cells it evaluates for the criteria - Wildcard characters (* and ?) let you match partial text, making SUMIF powerful for categorizing data with inconsistent naming conventions
Introduction to SUMIF
SUMIF is Excel’s conditional summing workhorse. It adds up values that meet a specific criterion, eliminating the need to filter data manually or create helper columns. If you’ve ever found yourself filtering a dataset, noting the sum at the bottom, then filtering again for another category, SUMIF is the solution you need.
The basic syntax is straightforward: =SUMIF(range, criteria, [sum_range]). The range is where Excel looks for your condition, criteria defines what to match, and sum_range (optional) specifies which values to add up. When you omit sum_range, Excel sums the values in the range itself.
Use SUMIF when you have one condition. Need multiple conditions? That’s when SUMIFS comes in. Need to count instead of sum? Use COUNTIF. But for single-condition totals, SUMIF is faster to write and easier to read than alternatives.
Basic SUMIF Examples
Let’s start with a sales dataset to illustrate the fundamentals:
| A | B | C |
|------------|----------|--------|
| Salesperson| Region | Sales |
| John | East | 4500 |
| Sarah | West | 7200 |
| Mike | East | 3800 |
| Lisa | West | 8500 |
| John | East | 6200 |
To sum all sales greater than 5000:
=SUMIF(C2:C6, ">5000")
This returns 21,900 (7200 + 8500 + 6200). Notice we’re using only two parameters because we’re evaluating and summing the same range.
For text matching, sum all sales from the East region:
=SUMIF(B2:B6, "East", C2:C6)
This returns 14,500 (4500 + 3800 + 6200). Here we need all three parameters: check column B for “East”, then sum corresponding values from column C.
Date-based conditions work similarly. With a date column, sum all transactions after January 15, 2024:
=SUMIF(A2:A100, ">1/15/2024", B2:B100)
Excel interprets dates as numbers, so comparison operators work naturally. Just ensure your date format matches your regional settings.
Working with Different Criteria Types
SUMIF supports six comparison operators: >, <, >=, <=, <> (not equal), and = (equal, which is implicit). Always wrap these in quotes when typing them directly: ">1000", "<>0", ">=100".
Wildcards unlock powerful pattern matching. The asterisk (*) matches any sequence of characters, while the question mark (?) matches exactly one character:
| A | B |
|----------|--------|
| SKU | Stock |
| ELEC-001 | 45 |
| ELEC-002 | 23 |
| FURN-001 | 12 |
| ELEC-003 | 67 |
To sum all electronics inventory (SKUs starting with “ELEC”):
=SUMIF(A2:A5, "ELEC*", B2:B5)
This returns 135 (45 + 23 + 67). The wildcard matches “ELEC-001”, “ELEC-002”, and “ELEC-003” but excludes “FURN-001”.
For partial matches in the middle, use wildcards on both sides:
=SUMIF(A2:A100, "*-002", B2:B100)
This sums all items with SKUs ending in “-002”.
Cell references as criteria make formulas dynamic. Instead of hardcoding “East”, reference a cell:
=SUMIF(B2:B6, E1, C2:C6)
Now changing the value in E1 automatically updates your sum. This is essential for interactive dashboards and reports.
When using cell references with operators, concatenate them:
=SUMIF(C2:C6, ">"&E1)
If E1 contains 5000, this formula sums values greater than 5000.
Common Use Cases
Category-based summing is SUMIF’s bread and butter. Consider a monthly expense tracker:
| A | B | C |
|------------|----------|---------|
| Date | Category | Amount |
| 1/5/2024 | Food | 125.50 |
| 1/7/2024 | Transport| 45.00 |
| 1/8/2024 | Food | 89.75 |
| 1/12/2024 | Utilities| 200.00 |
| 1/15/2024 | Food | 156.25 |
Create a summary section with category totals:
| E | F |
|------------|----------------------------|
| Food | =SUMIF($B$2:$B$100, E1, $C$2:$C$100) |
| Transport | =SUMIF($B$2:$B$100, E2, $C$2:$C$100) |
| Utilities | =SUMIF($B$2:$B$100, E3, $C$2:$C$100) |
The dollar signs create absolute references for the data ranges while keeping the category reference relative, allowing you to copy the formula down.
For date ranges, combine SUMIF formulas. To sum expenses for a specific month:
=SUMIF(A2:A100, ">=1/1/2024", C2:C100) - SUMIF(A2:A100, ">=2/1/2024", C2:C100)
This calculates January totals by summing everything from January 1st onward, then subtracting everything from February 1st onward. For multiple conditions on the same range, SUMIFS is cleaner, but this technique works in a pinch.
Budget tracking becomes straightforward. With a budget column and actual spending column:
=SUMIF(D2:D50, ">0", C2:C50) // Sum all overbudget items
Where column D contains formulas like =C2-B2 (actual minus budget).
SUMIF Pitfalls and Best Practices
SUMIF is not case-sensitive. =SUMIF(A1:A10, "apple") matches “apple”, “Apple”, and “APPLE”. If you need case-sensitive matching, you’ll need an array formula with SUMPRODUCT and EXACT functions instead.
Blank cells in the sum range are treated as zero, which is usually what you want. But blank cells in the criteria range can cause unexpected results. Excel treats blank cells as zero for numeric comparisons, so >0 excludes blanks while <>0 also excludes them.
Performance degrades with massive datasets. SUMIF is efficient for thousands of rows, but with hundreds of thousands, consider PivotTables or Power Query instead. Each SUMIF recalculates when any cell changes, so dozens of SUMIF formulas in a workbook can slow down editing.
When you need multiple conditions, switch to SUMIFS immediately. Don’t try to nest SUMIF formulas or create complex helper columns. SUMIFS handles multiple criteria cleanly:
=SUMIFS(C2:C100, B2:B100, "East", A2:A100, ">1/1/2024")
This is more readable and faster than alternatives.
Always use absolute references for your data ranges if you’re copying formulas. $C$2:$C$100 prevents range shifting when you copy formulas across cells.
Troubleshooting Common Errors
The #VALUE! error typically means data type mismatches. If your criteria range contains numbers but you’re searching for text, or vice versa, you’ll see this error:
// INCORRECT - Numbers stored as text
=SUMIF(A2:A10, ">1000", B2:B10) // Returns #VALUE! if A2:A10 contains text
// CORRECT - Convert or match the data type
=SUMIF(A2:A10, ">""1000""", B2:B10) // Treats criteria as text
Or better yet, fix the source data so numbers are actually numbers, not text that looks like numbers.
Range size mismatches cause incorrect results, not errors. SUMIF doesn’t warn you if your criteria range and sum range are different sizes:
// INCORRECT - Mismatched ranges
=SUMIF(B2:B10, "East", C2:C15) // Will only sum C2:C10
// CORRECT - Matching ranges
=SUMIF(B2:B15, "East", C2:C15)
Excel only processes rows where both ranges overlap, silently ignoring the extra rows.
Criteria formatting requires attention to detail. Numbers need quotes when combined with operators, but not when used alone:
// INCORRECT
=SUMIF(A2:A10, >1000, B2:B10) // Syntax error
// CORRECT
=SUMIF(A2:A10, ">1000", B2:B10)
// ALSO CORRECT - Direct number without operator
=SUMIF(A2:A10, 1000, B2:B10) // Sums where A equals exactly 1000
Here’s a side-by-side comparison of common mistakes:
| Incorrect Formula | Issue | Correct Formula |
|--------------------------------------------|----------------------|----------------------------------------------|
| =SUMIF(A2:A10, >100, B2:B10) | Missing quotes | =SUMIF(A2:A10, ">100", B2:B10) |
| =SUMIF(A2:A10, "West", B2:B15) | Range mismatch | =SUMIF(A2:A10, "West", B2:B10) |
| =SUMIF(A2:A10, ">"&B1, C2:C10) | Wrong sum range | =SUMIF(A2:A10, ">"&B1, B2:B10) |
| =SUMIF(A2:A10, "*apple", B2:B10) | Case assumption | Works, but know it's case-insensitive |
When debugging, break down your formula. Test the criteria range separately, verify your sum range contains numbers, and check that ranges align properly. Use Evaluate Formula (Formulas tab) to step through calculation logic.
SUMIF is one of those functions that seems simple until you hit edge cases. Master the basics, understand the pitfalls, and you’ll build reliable spreadsheets that scale beyond quick one-off calculations.