EXCEL SOLUTIONS

SUMIF function in Excel

Adds up the numbers in one range when another range meets a condition. For example, total quantity for Pen.

BeginnerTotals and maths

Syntax

=SUMIF(range, criteria, [sum_range])
Arguments of SUMIF
ArgumentWhat it means
rangeThe cells to test against the condition.
criteriaThe condition, such as "Pen" or ">100".
sum_rangeThe numbers to add. If you leave it out, the tested range itself is added.

Examples with results

Every result below is calculated by the practice engine on the sample data shown, not typed in by hand.

Office supplies sales (fictional)

RowABCDE
1ItemQtyUnit priceRegionDate
2Pen101.5North2025-01-15
3Notebook512South2025-02-03
4Pen201.5South2025-02-28
5Stapler240North2025-03-10
6Folder153.25East2025-03-22
7Notebook812East2025-04-05
8Pen121.5North2025-04-18
9Marker302South2025-05-02
Office supplies sales (fictional) Row 1 holds the headings. All data is fictional. Dates are year-month-day.

Download CSV

  • =SUMIF(A2:A9,"Pen",B2:B9)42

    Total Pen quantity

  • =SUMIF(D2:D9,"South",B2:B9)55

    Total quantity sold in the South

  • =SUMIF(B2:B9,">=10")87

    Add only the quantities that are 10 or more

Try it yourself

Change the formula or switch to other sample data.

Press Calculate to see the result.

The practice box runs in your browser with BDK’s own calculator, which covers about 60 common functions. Cell references work as in Excel (B2, B2:B9). Your formulas are not saved or sent anywhere. For anything unusual, check the result in Excel itself.

How people use SUMIF at work

  • Personal budgeting

    Total what you spent on categories that went over plan.

    =SUMIF(C2:C7,">200")1962
    Data: Monthly budget (fictional)
  • Sales

    Sales by region.

    =SUMIF(D2:D9,"North",B2:B9)24
    Data: Office supplies sales (fictional)

Common mistakes and tips

  • The tested range and the sum range must line up row for row.
  • For more than one condition use SUMIFS. Note that SUMIFS puts the sum range first.

Works in

All versions of Excel, and Google Sheets.

Related formulas

SUMIFSCOUNTIFAVERAGEIF

Lessons that use it

Need Something Different? Let’s Talk.

Looking for different features or something built around your workflow? Share your idea with us.