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
Show the answer
=COUNTIF(B4:B23,"March") = 8.
Exercise 2
Show the answer
=SUMIF(D4:D23,"<100") = $512.00.
Exercise 3
Show the answer
=COUNTIFS(C4:C23,"Stationery",B4:B23,"January") = 3.
Exercise 4
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
Show the answer
=SUMIF(B4:B23,"February",D4:D23) = $1,187.00.
Exercise 6
=SUMIFS(C4:C23,"Furniture",D4:D23) to get the furniture total. What did he do wrong? Write the correct formula.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.
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.