The book: files and exercises · Lesson 9 of 24

Lesson 9 exercises: SUMIF, COUNTIF and the IFS versions

Six exercises on SUMIF, COUNTIF and the IFS versions with several conditions, with the sales log from lesson09.xlsx. Type the formula in the free cell E4: the page checks the ranges, the criteria and the quotes.

Lesson 9. SUMIF, COUNTIF, AVERAGEIF and their IFS versions

Use the file lesson09.xlsx, Sales sheet.

Files: lesson09.xlsx · solutions: lesson09-solutions.xlsx.

In the exercises with a sheet, type the formula in the fx bar and click Check: the sheet works it out the way Excel does, with commas between the arguments (semicolons work too), and also tries it with other data, to see whether it still works when the data changes. In the other exercises, you work in Excel with the lesson's file and type the result here.

At the end of the page you'll find the lesson's Bonus challenge: one more exercise, whose answer isn't in the book. You check it only here.

Exercise 1

How many sales were there in March? Use COUNTIF on the Month column.
In cell E4
fx
Show the answer

=COUNTIF(B4:B23,"March") = 8.

Exercise 2

What is the total of the sales under $100? (Hint: if the range to add up is the same as the range you look in, the first two arguments of SUMIF are enough.)
In cell E4
fx
Show the answer

=SUMIF(D4:D23,"<100") = $512.00.

Exercise 3

How many stationery sales were there in January?
In cell E4
fx
Show the answer

=COUNTIFS(C4:C23,"Stationery",B4:B23,"January") = 3.

Exercise 4

What is the average of the furniture sales over $200?
In cell E4
fx
Show the answer

=AVERAGEIFS(D4:D23,C4:C23,"Furniture",D4:D23,">200") = $440.00 (320, 760 and 240: $1,320.00 divided by 3).

Exercise 5

What is the total of all the sales in February, all categories together?
In cell E4
fx
Show the answer

=SUMIF(B4:B23,"February",D4:D23) = $1,187.00.

Exercise 6

Without Excel: a coworker typed =SUMIFS(C4:C23,"Furniture",D4:D23) to get the furniture total. What did he do wrong? Write the correct formula.
What did he do wrong?
Type the correct formula in E4
fx
Show the answer

He used the SUMIF order: in SUMIFS, the range to add up comes first. Correct: =SUMIFS(D4:D23,C4:C23,"Furniture").

Bonus challenge

The answer isn't in the book: you check it only here.

A coworker swears that in February computers brought in more than furniture and stationery put together. Is he right? On the Sales sheet, type one single formula: the February computer sales minus the February sales of every other category. What do you get?
In cell E4
fx
Show the answer

=SUMIFS(D4:D23,B4:B23,"February",C4:C23,"Computers")-SUMIFS(D4:D23,B4:B23,"February",C4:C23,"<>Computers") = $263.00. The first SUMIFS adds up the February computer sales ($725.00); the second adds up the February sales of every other category, because the condition "<>Computers" means "not equal to Computers" and picks up furniture and stationery in one go. The result is positive, so your coworker is right: in February, computers brought in more than furniture and stationery put together.