Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Data Analysis

atomictds
atomictds
333 Points

Using SUMIF

For "sum of the value of F&B and Entertainment" in the quiz, advice is to use SUMIF. In Google sheets, the format Google Sheets gives me to use is : SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, …], [criterion2, …]) and the example they give on HOW to use it is: SUMIFS(A1:A10, B1:B10, ">20", C1:C10, "<30").

Where do you get criterion1(">20"in example) and criterion2("<30" in example)?

And why doesn't just filtering out everything except F&B and Entetainment not work?

2 Answers

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Treehouse Project Reviewer

Hey atomictds ,

I'm assuming you're referring to this quiz. If so, it's not asking for Entertainment, just F&B.

I would recommend using SUMIF since that is what the challenge is asking for and what was taught. You'll want to use it just as it was used in this video, have it give you a total and copy/paste that total into this quiz.

Steven Parker
Steven Parker
241,955 Points

You didn't provide a link to the Google page where you saw the example, but based on the formula you show it's including only rows where the value in column B is greater than 20 and the value in column C is less than 30. You won't need SUMIFS (plural) for this since there's only one criterion (the category) used in the quiz question. You can use SUMIF twice (once for each category) and add them.

And I assume your 2nd question is why a simple SUM doesn't work when using column filters, and that's because the filters only affect which rows are displayed but it does not constrain which are included in the sum. You could always copy the filtered amounts to another column and sum that one, but SUMIF is a better solution and doesn't require filtering or copying.