SUMIF Function
The Excel SUMIF function adds values that meet one condition. The tested range and summed range can be the same or separate, provided their rows remain aligned.
| Excel SUMIF Function | |||||||
| Sum values when one condition is met; source data, criteria, syntax, and live totals stay in one view. | |||||||
| Source data, editable | SUMIF examples | ||||||
| Category | Status | Amount | Example | Criterion | Formula syntax | Result | |
| Travel | Approved | 1,200.0 | Selected category total | Travel | =SUMIF(A12:A21,F12,C12:C21) | 4,390.0 | |
| Software | Approved | 850.0 | Selected status total | Approved | =SUMIF(B12:B21,F13,C12:C21) | 5,635.0 | |
| Travel | Pending | 1,450.0 | Amounts above threshold | >1000 | =SUMIF(C12:C21,F14,C12:C21) | 6,575.0 | |
| Facilities | Approved | 0.0 | |||||
| Software | Pending | 1,100.0 | How to read the examples | ||||
| Travel | Approved | 760.0 | The criteria range decides which rows qualify. | ||||
| Software | Approved | 1,325.0 | The editable criterion can be text, a number, or an operator expression. | ||||
| Facilities | Rejected | -100.0 | The result updates when source values or the criterion changes. | ||||
| Travel | Pending | 980.0 | |||||
| Facilities | Approved | 1,500.0 | |||||
| Reliability checks | |||||||
| Travel total reconciles to its four visible source rows | OK | ||||||
| Approved total includes zero and the negative row only when criteria match | OK | ||||||
Overview
The Excel SUMIF function creates a conditional total. It tests one range against a criterion and adds either the matching cells in that range or the corresponding cells in a separate sum_range.
Quick reference
Syntax: =SUMIF(range, criteria, [sum_range])
Returns: The sum of numeric values whose corresponding cells satisfy the criterion. (number)
Arguments:
range(required) — The cells tested against the criterion.criteria(required) — The text, number, expression, cell reference, or wildcard pattern that determines which rows qualify.sum_range(optional) — The cells to add for qualifying positions; when omitted, Excel sums numeric cells in range.
The bracketed sum_range argument is optional. When omitted, Excel sums qualifying numeric cells in range; when supplied, it must align positionally with the tested range.
Common uses
- Total expenses for one category.
- Sum approved, open, or overdue amounts.
- Add values above or below a threshold.
- Total amounts for dates before or after a cutoff.
Calculations
SUMIF first evaluates each cell in range. When a cell satisfies criteria, Excel adds the value at the same relative position in sum_range. If sum_range is omitted, the tested range is also the range being summed.
The tested and summed ranges should cover corresponding rows. Excel can resize a sum_range from its upper-left cell, but relying on that behavior can produce a plausible total from unintended cells. Explicit, equal-sized ranges are easier to audit.
Criteria can be text, a number, a cell reference, or an expression such as ">1000". To combine an operator with a value stored in a cell, concatenate them, as in ">"&F14. Text comparisons are not case-sensitive, and wildcard matching is available for text.
Function behavior
Situation | Behavior |
|---|---|
Omitted | Numeric cells in |
No matches | Returns |
Text in | Ignored because it is not numeric. |
Zero | Included when its row qualifies but does not change the total. |
Negative values | Reduce the total when their rows qualify. |
Blank criteria | |
Text case and wildcards | Matching is not case-sensitive; |
Range alignment | |
Errors | A relevant error in a tested or summed cell can propagate to the result. |
Common errors
Reversing range and sum_range
What happens:
Excel tests the amount cells and attempts to sum the category or status cells, producing zero or the wrong result.
Better approach:
Put the field being tested first and the numeric values to add third.
Omitting sum_range when another column should be totaled
What happens:
Excel tries to sum numeric cells in the criteria range itself.
Better approach:
Supply the aligned amount range explicitly whenever the tested and summed fields differ.
Using mismatched boundaries
What happens:
Qualifying rows can map to unintended values because Excel aligns positions from the upper-left cells.
Better approach:
Use ranges with the same number of rows and matching start and end records.
Adding a second condition
What happens:SUMIF has no second range-criterion pair.
Better approach:
Use SUMIFS for two or more AND-based conditions.
Example
Example 1 — Sum by Category
=SUMIF(A12:A21,F12,C12:C21)
With Travel in F12, the workbook adds four matching Amount values and returns 4,390.
Example 2 — Sum by Status
=SUMIF(B12:B21,F13,C12:C21)
This tests the Status column and sums the aligned Amount column. Approved rows total 5,635.
Example 3 — Test and Sum the Same Range
=SUMIF(C12:C21,F14,C12:C21)
The Amount range is used for both the comparison and the total. With >1000 in F14, the result is 6,575.
Example workbook
The workbook contains a SUMIF Example sheet with ten editable Category, Status, and Amount records. Three live formulas demonstrate category, status, and threshold criteria, and two checks reconcile the Travel and Approved totals. A Notes sheet covers syntax, operators, and range alignment.
Key takeaway
Use SUMIF when one condition controls a total, and keep the tested range and summed range explicitly aligned.