Excel SUMIF

SUMIF adds the numbers on rows that meet a single condition.

A finance assistant has one long expense log and needs a figure for each department. Sorting and adding by hand is slow and easily broken. SUMIF asks one question of the whole list and gives the department total straight away.

Practice it now

How to write it

=SUMIF(range, criteria, [sum_range])
range
The cells to test.
criteria
The condition to meet.
sum_range
Optional cells to add, if different from the tested cells.

Watch it work

D2fx 
ABCDE
1DeptAmount
2Marketing540
3IT1200
4Marketing310
5HR95
6IT460
7Ops720
8
1

Test column A and add the matching amounts in column B.

Examples

Total spent by Marketing

=SUMIF(A2:A7,"Marketing",B2:B7)850

Test column A and add the matching amounts in column B.

Add only amounts above 500

=SUMIF(B2:B7,">500")2,460

When the tested cells are also the numbers, leave out the third argument.

Everything except IT

=SUMIF(A2:A7,"<>IT",B2:B7)1,665

The <> operator means not equal to.

Your turn

Total the amounts spent by IT. Type your formula in D2.

ABCD
1DeptAmount
2Marketing540
3IT1200
4Marketing310
5HR95
6IT460
7Ops720
8

Common mistakes

Mixing up the order with SUMIFS.

SUMIF has the numbers last. SUMIFS has them first.

A sum range of a different size.

Excel sizes it from the first cell, which can add the wrong rows. Keep both ranges the same height.

Good to know

  • Use "*" for partial matches, such as "Mark*".
  • Put the condition in a cell so one formula copies down a summary table.
  • SUMIF or SUMIFS? If there is any chance you will need a second condition later, start with SUMIFS.