How to Use the SUMIF Function in Excel

The standard SUM function in Microsoft Excel is perfect when you need to add up an entire column of numbers. However, real-world data is rarely that simple. What if you only want to add up the sales numbers for a specific region? Or sum up the invoices that are strictly greater than $500? Manually picking through hundreds of rows and highlighting specific cells to add together is tedious and prone to error. The SUMIF function combines the mathematical power of SUM with the logical filtering of an IF statement, allowing you to selectively add numbers based on specific criteria.

Understanding the SUMIF Syntax

The SUMIF function is slightly more complex than a basic SUM because it requires up to three pieces of information to work correctly. The syntax looks like this: =SUMIF(range, criteria, [sum_range]).

  • Range: Where should Excel look for your condition? (e.g., The column containing region names).
  • Criteria: What is the specific condition? (e.g., “North”).
  • Sum_Range (Optional): Which numbers should it actually add together? (e.g., The column containing the sales figures). If your Range and Sum_Range are the same column (like adding all numbers >500), you don’t need this third part.

Step-by-Step: Using SUMIF with a Text Condition

The most common scenario is adding values based on a text label. Imagine Column A lists regions (“North”, “South”) and Column B lists sales revenue.

  1. Click the empty cell where you want your total for the “North” region to appear.
  2. Type: =SUMIF(
  3. Select the Range: Highlight Column A (the regions). Type a comma ,.
  4. Enter the Criteria: Type your condition in quotation marks. Type "North". Type a comma ,.
  5. Select the Sum_Range: Highlight Column B (the revenue).
  6. Type a closing parenthesis ) and press Enter.

The final formula is =SUMIF(A:A, "North", B:B). Excel will scan Column A, and every time it finds the exact word “North”, it will take the corresponding number from Column B and add it to the running total.

Step-by-Step: Using SUMIF with a Logical/Number Condition

You can also use SUMIF to analyze numbers directly, utilizing logical operators (greater than, less than, etc.). Imagine you want to sum all invoices in Column C that are greater than $1,000.

  1. Click an empty cell and type: =SUMIF(
  2. Select the Range: Highlight Column C (the invoice amounts). Type a comma ,.
  3. Enter the Criteria: You must enclose logical operators in quotation marks. Type ">1000".
  4. Because you are evaluating the numbers and adding those exact same numbers, you do not need the third Sum_Range argument.
  5. Type a closing parenthesis ) and press Enter.

The final formula is =SUMIF(C:C, ">1000"). Excel will scan the column and add together only the numbers larger than 1,000.

Troubleshooting Common Mistakes

If your SUMIF formula returns 0 or an incorrect total, check these common pitfalls:

  • Trailing Spaces in Text: If your formula looks for “North”, but the data entry in Column A is actually “North ” (with a hidden space at the end), SUMIF will ignore it. You must clean your data (using the TRIM function) or use wildcards in your criteria like "*North*".
  • Mismatched Ranges: If your Range is A2:A100 but your Sum_Range is B2:B90, the formula will misalign and calculate incorrectly. Always ensure your criteria range and your sum range are exactly the same height. (Using entire columns, like A:A and B:B, usually prevents this issue).

By mastering SUMIF, you can instantly extract targeted financial totals and summaries from massive, disorganized datasets.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.