How to Use SUMIF in Excel: Simple Guide with Examples
Use the
SUMIF function in Excel to add values that meet a specific condition. The formula looks like =SUMIF(range, criteria, [sum_range]), where range is checked against the criteria, and matching values in sum_range are added.Syntax
The SUMIF function has three parts:
- range: The cells you want to check for the condition.
- criteria: The condition that decides which cells to add.
- sum_range (optional): The cells to add if the condition is true. If omitted, Excel adds the cells in
range.
excel
=SUMIF(range, criteria, [sum_range])Example
This example adds sales amounts only for the product "Apple".
excel
A1:A5 (Products): Apple, Banana, Apple, Orange, Apple B1:B5 (Sales): 10, 20, 15, 5, 25 Formula in C1: =SUMIF(A1:A5, "Apple", B1:B5)
Output
50
Common Pitfalls
Common mistakes include:
- Forgetting quotes around text criteria, e.g., use
"Apple"notApple. - Not matching the size of
sum_rangetorange. - Using wrong operators without quotes, e.g., use
">10"not>10.
excel
Wrong: =SUMIF(A1:A5, Apple, B1:B5) (missing quotes around Apple)
Right: =SUMIF(A1:A5, "Apple", B1:B5)Quick Reference
| Part | Description | Example |
|---|---|---|
| range | Cells to check condition | A1:A5 |
| criteria | Condition to match | "Apple" or ">10" |
| sum_range | Cells to add if condition true | B1:B5 (optional) |
Key Takeaways
Use SUMIF to add numbers based on a condition in another range.
Always put text criteria inside quotes, like "Apple".
Make sure sum_range matches the size of range if used.
Use quotes around operators in criteria, e.g., ">10".
If sum_range is omitted, SUMIF adds cells from range itself.