SUMIF
Adds the cells specified by a given condition.
=SUMIF(range, criteria, [sum_range])This static page keeps the function indexed for search, while the spreadsheet app handles interactive exploration and saved formulas.
What the function does
Overview
Adds the cells specified by a given condition.
The SUMIF function performs a conditional sum by evaluating a single range against a specific criterion. It supports a wide array of criteria including logical operators (>, <, <>, =), wildcards (*, ?), and direct cell references. For best practices, ensure the 'range' and 'ange' are of identical size and shape. If the 'ange' is omitted, Excel sums the values in the 'range' argument itself. A critical edge case involves mismatched range sizes: Excel does not return an error but instead dynamically determines the sum area starting from the top-left cell of the 'ange', which often leads to inaccurate totals. Additionally, text criteria and logical operators must be enclosed in double quotes. For multiple criteria, users should transition to the SUMIFS function, which is optimized for multi-conditional logic.
Quick reference
Syntax
=SUMIF(range, criteria, [sum_range])
Inputs
Arguments
Example: A2:A100
Example: ">1000"
Example: B2:B100
Formula patterns
Examples
Sum values based on a text category
=SUMIF(A2:A10, "Furniture", C2:C10)Sum values greater than a numeric threshold
=SUMIF(B2:B20, ">500")Sum values using partial match wildcards
=SUMIF(A2:A15, "*Total", B2:B15)Avoid these issues
Common Errors
#VALUE!
Cause: The criteria string is longer than 255 characters or the formula refers to a closed external workbook.
Fix: Shorten the criteria string or ensure the referenced workbook is currently open.
Misaligned Ranges
Cause: The 'range' and 'sum_range' arguments have different dimensions (e.g., A2:A10 and B2:B20).
Fix: Modify the range references so they represent the same number of rows and columns (e.g., A2:A20 and B2:B20).
Platform support
Compatibility
Source: Microsoft Support
Common questions
Frequently Asked Questions
Adds the cells specified by a given condition.
range: The range of cells to check criteria against criteria: The condition (number, expression, or text) ange: The cells to add (if different from range)
#VALUE!: Shorten the criteria string or ensure the referenced workbook is currently open. Misaligned Ranges: Modify the range references so they represent the same number of rows and columns (e.g., A2:A20 and B2:B20).