Other Links

 

 

Tutorial on VBA for Excel (macros)

This is one of the 30 lessons from the
Tutorial on Excel Formulas


Lesson 3-18A: SUMIF  Function

The SUMIF Function

The general format for the SUMIF formula is as follow: =SUMIF(range where criteria applies, criteria, sum what)
Applied to the following table, the result of the following formula should be 14:
=SUMIF(C2:C7,"John" ,D2:D7)
or
=SUMIF(C2:C7,C2 ,D2:D7)

 

A

B

C

D

1

Month

State

Name

Amount

2

May

MI

John

2

3

Jun

NY

Peter

6

4

Mar

PA

John

8

5

Dec

NH

Peter

3

6

Nov

RI

John

4

7

Oct

FL

Peter

6

The SUMIF function is limited to one criteria (one column). If you want to sum the amounts based on month, State and name, discover the very simple SUMPRODUCT function with which you can use 2, 3 or more criteria with "or" or  "and" ...SUMPRODUCT is like SUMIF on steroids.