Skip to content

Excel function guide · Conditional sums & counts

SUMIF function in Excel

SUMIF adds the values in a range that meet one condition, for example all the expenses in the Travel category. You give it the range to test, the condition, and the range to add.

Syntax

=SUMIF(range, criteria, [sum_range])
ArgumentRequired?What it means
rangeRequiredThe cells to test against the condition.
criteriaRequiredThe condition: a value ("Travel"), a cell, a comparison (">100") or a wildcard pattern ("T*").
sum_rangeOptionalThe cells to add. Leave it out to add the tested cells themselves.

SUMIF examples

Every example uses this small table. The results are what Excel shows in the cell.

ABC
1CategoryItemAmount
2TravelTrain to Leeds86
3MealsClient lunch142
4TravelHotel, 2 nights310
5OfficePrinter paper24
6MealsTeam breakfast58
7TravelTaxi31
  1. 1. Total for a category

    =SUMIF(A2:A7, "Travel", C2:C7)

    Result: 427

    Adds the Amount on every Travel row: 86 + 310 + 31.

  2. 2. Amounts over 100

    =SUMIF(C2:C7, ">100")

    Result: 452

    No sum_range: SUMIF adds the tested cells themselves, 142 + 310.

  3. 3. Wildcard match

    =SUMIF(B2:B7, "T*", C2:C7)

    Result: 175

    Items starting with T: Train to Leeds, Team breakfast and Taxi. * stands for any characters, ? for exactly one.

Try it now

Practise SUMIF in a live sheet.

Type each formula yourself. Answers are checked by the same engine as the full course. No account needed.

Try it · SUMIF
0 XP
E3
A
B
C
D
E
F
1
Category
Item
Amount
Question
Answer
2
Travel
Train to Leeds
86
Category
Meals
3
Meals
Client lunch
142
Total for E2
4
Travel
Hotel, 2 nights
310
Over 50
5
Office
Printer paper
24
Not Travel
6
Meals
Team breakfast
58
7
Travel
Taxi
31
8
Double-click or start typing to edit

Step 1 of 3

In E3, total the amounts for the category in E2.

Common SUMIF mistakes

Practise this in Excel Quest

COUNTIF & SUMIFFree

Course 5 · Conditional Aggregation · 11 min

Count and total only the rows that match — then build a region summary that reconciles to the total.

This lesson is free: create an account and it opens straight away.

Related functions

All Excel function guides