SUMIF and SUMIFS
Although Excel can do extremely complex calculations, the majority of what you're likely to do is very basic: add, subtract, multiply, divide, average, etc. And it's also likely that you're only going to want to do this things to a portion of your list...that is, values meeting certain criteria. In this lesson, we're going to describe some very simple, but useful, functions.
SUMIF / SUMIFS / AVERAGEIF
Let's start with one of the more useful (and self-explanatory) functions: SUMIF. We'll use a simple list of purchased goods over the course of a college student's typical week.
A | B | C | D | |
1 | Date | Store | Item | Cost |
---|---|---|---|---|
2 | Monday | McDonald's | Lunch | $8.54 |
3 | Tuesday | Rah Sushi | Lunch | $23.45 |
4 | Tuesday | Target | Clothing | $13.21 |
5 | Wednesday | Kmart | Clothing | $45.41 |
6 | Wednesday | McDonald's | Lunch | $7.45 |
7 | Thursday | Circle K | Gas | $43.98 |
8 | Friday | McDonald's | Dinner | $12.32 |
There are a lot of things we could do with this list. To name a few:
Scenario 1: Total expenses for the week - SUM
Scenario 2: Total expenses allocated towards clothing - SUMIF
Scenario 3: Total expenses associated with lunch at McDonald's - SUMIFS
Scenario 4: Average cost of lunch - AVERAGEIF
A | B | C | D | |
1 | Date | Store | Item | Cost |
---|---|---|---|---|
2 | Monday | McDonald's | Lunch | $8.54 |
3 | Tuesday | Rah Sushi | Lunch | $23.45 |
4 | Tuesday | Target | Clothing | $13.21 |
5 | Wednesday | Kmart | Clothing | $45.41 |
6 | Wednesday | McDonald's | Lunch | $7.45 |
7 | Thursday | Circle K | Gas | $43.98 |
8 | Friday | McDonald's | Dinner | $12.32 |
8 | Friday | McDonald's | Dinner | $12.32 |
9 | ||||
10 | Scenario | Value | Formula | |
11 | 1 | $154.36 | =SUM(D2:D8) | |
12 | 2 | $58.62 | =SUMIF(C2:C8,"Clothing",D2:D8) | |
13 | 3 | $15.99 | =SUMIFS(D2:D8,B2:B8,"McDonald's",C2:C8,"Lunch") | |
14 | 4 | $13.15 | =AVERAGEIF(C2:C8,"Lunch",D2:D8) |
Scenario 1: SUM()
The first scenario describes the simplest example, where you want to add all of the items in column D to obtain the total cost. Note that you can add many items to the SUM() function by separating them with a comma. If, for example, you wanted to add the line items in rows 3, 5, and 7, you would use =SUM(D3,D5,D7).
SCENARIO 2: SUMIF()
blah blah blah
Scenario 3: SUMIFS()
Blah blah blah
SCENARIO 4: AVERAGEIF()
blah blah blah