The SUM function adds up a range of numbers in Excel, while SUMIF adds numbers that meet a specific condition. Both are essential for basic and advanced data analysis, and no special tools or add-ins are required—just Excel installed on your device (Windows, Mac, or online).

What You'll Need

  • Microsoft Excel (any recent version: Excel 2010, 2013, 2016, 2019, 2021, Microsoft 365, or Excel for the web)
  • A worksheet with numeric data you want to add (e.g., sales figures, expenses, inventory counts)
  • For SUMIF, a column of values to evaluate (criteria range) and another with values to sum (sum range)

Step-by-Step

  1. Open your Excel workbook and navigate to the sheet containing the data you want to sum.
  2. Click the cell where you want the SUM result to appear (e.g., cell E10 for a total sales figure).
  3. Type =SUM( (including the opening parenthesis), then either:
    • Drag your mouse to select the range (e.g., A2:A20), or
    • Manually type the range (e.g., =SUM(A2:A20)), or
    • Hold Ctrl (Cmd on Mac) and click individual cells or ranges to add non-contiguous cells.
  4. Close the parenthesis and press Enter. Excel will display the total of all visible numbers in the range. Text, logical values (TRUE/FALSE), and empty cells are ignored automatically.
  5. For SUMIF, click a new empty cell (e.g., F10) and type =SUMIF(.
  6. Enter the three arguments in order, separated by commas:
    1. Range: the range to apply the condition to (e.g., B2:B50—the column with product names or categories).
    2. Criteria: the condition that must be met (e.g., "Apples", ">100", or reference to a cell like C1 where C1 contains "Apples").
    3. Sum_range (optional): the range to actually sum. If omitted, Excel sums the cells in the Range that meet the criteria. If included, it must match the size of the Range (e.g., C2:C50—the sales amounts).
  7. Close the parenthesis and press Enter. For example, =SUMIF(B2:B50,"Apples",C2:C50) adds all sales where the product is "Apples".
  8. To use a cell reference for criteria (recommended for flexibility), type =SUMIF(B2:B50,E1,C2:C50) where E1 contains the text "Apples" or a number like 100.

Common Mistakes

  • Incorrect range sizes: When using SUMIF with a sum_range, it must be the same size and shape as the criteria_range. Mismatched ranges (e.g., B2:B50 and C2:C60) cause #VALUE! or incorrect totals.
  • Text criteria without quotes: If your criteria is text (e.g., "Apples"), it must be enclosed in double quotes inside the formula. Typing =SUMIF(B2:B50,Apples,C2:C50) returns #NAME? error.
  • Logical operators in criteria: Use ">100" (not >100 alone or with single quotes). For numbers, ">=50" works, but avoid mixing quotes with cell references—use ">" & F1 instead of ">F1".
  • Whitespace or invisible characters: Extra spaces in criteria (e.g., "Apples " vs "Apples") cause matches to fail. Use =TRIM() on source data or =SUMIF(TRIM(B2:B50),"Apples",...) (but note SUMIF does not accept array functions—clean data first).
  • Assuming SUMIF works with OR logic: SUMIF only handles one condition. To sum if Apples OR Bananas, use multiple SUMIFs (e.g., =SUMIF(B2:B50,"Apples",C2:C50)+SUMIF(B2:B50,"Bananas",C2:C50)) or switch to SUMIFS or SUMPRODUCT.

Tips

  • Use Excel’s AutoSum button (Σ on the Home or Formulas tab) for quick SUM: select the cell below or to the right of your data, then click AutoSum—Excel guesses the range and inserts the formula.
  • For SUMIF, always put criteria in a separate cell (e.g., E1) and reference it in the formula. This lets users change the condition without editing the formula.
  • Press F4 after typing a range (e.g., B2:B50) to lock it as an absolute reference ($B$2:$B$50), so dragging the formula won’t shift the range.
  • Use wildcards in text criteria: "A*" matches any text starting with "A", "*s" matches any ending in "s", and "?pple" matches "apple" or "appLe" (one character).
  • For case-insensitive matching, SUMIF is already case-insensitive by default—"apples", "Apples", and "APPLES" all match "Apples" in criteria.
  • When summing financial data, format result cells as Currency or Accounting to avoid decimal errors and improve readability.

Troubleshooting

If your SUM or SUMIF formula doesn’t work, follow these steps in order:

  1. Check for #NAME? error: This usually means a typo in the function name (e.g., SUMIF vs Sumif—case doesn’t matter, but spelling does) or missing quotes around text criteria. Verify the formula syntax and retype the function name if needed.
  2. Verify cell references: Ensure ranges include only numeric data for summing. If the sum_range contains text (e.g., "N/A"), SUMIF ignores those rows, possibly leading to a lower total than expected.
  3. Check for hidden rows or filters: SUM and SUMIF include hidden rows in calculations. If you’re filtering data and want to sum only visible rows, use SUBTOTAL instead (e.g., =SUBTOTAL(9,range) for SUM).
  4. Inspect criteria format: For date criteria, Excel stores dates as serial numbers (e.g., Jan 1, 2025 = 45309). To sum sales after Jan 1, 2025, use =SUMIF(A2:A50,">"&DATE(2025,1,1),B2:B50) or reference a cell containing the date.
  5. Test with a simple case: Create a tiny test table (e.g., A1:B3 with headers, values, and criteria) and manually calculate what the result should be. Compare to your formula to isolate the issue.
  6. Use Formula Auditing: Go to Formulas > Evaluate Formula to step through the calculation. Also, click Trace Precedents to see which cells feed into the formula.

Frequently Asked Questions

Can SUMIF handle multiple conditions?

No, SUMIF only handles one condition. Use SUMIFS (note the "S") instead, which supports up to 127 criteria pairs. Example: =SUMIFS(C2:C50,B2:B50,"Apples",D2:D50,">100") sums sales where product is "Apples" and quantity > 100.

Why does SUMIF return 0 when I expect a number?

This usually means no values meet your criteria. Double-check: (1) the criteria text matches exactly (including spaces), (2) the sum_range contains numbers (not formatted as text), and (3) ranges align correctly. Use =ISNUMBER() on your sum_range to verify.

Can I use SUMIF with dates?

Yes. Use comparison operators with a date value or cell. Example: =SUMIF(A2:A100,">="&DATE(2024,1,1),B2:B100) sums values where dates are on or after Jan 1, 2024. Alternatively, reference a cell (e.g., E1) containing the start date and use ">=" & E1.

Does SUM ignore text cells?

Yes. SUM only adds numeric values. If a range has "10" (text) and 20 (number), SUM treats "10" as zero and adds only 20. To sum text representations of numbers, convert them first using VALUE() or paste-special > multiply by 1.

What’s the difference between SUM and SUMIF?

SUM adds all numbers in a range without checking conditions. SUMIF adds only numbers where a specified condition is true. For example, SUM(A2:A10) totals all values, while SUMIF(A2:A10,">0",B2:B10) sums values in B2:B10 only where A2:A10 is positive.

Can I sum non-contiguous cells with SUMIF?

Not directly. SUMIF requires contiguous ranges for criteria_range and sum_range. Workaround: use SUMPRODUCT with multiple SUMIFs or restructure your data. For example: =SUMIF(A2:A10,"Apples",C2:C10)+SUMIF(A12:A20,"Apples",C12:C20).