calculate average with criteria

a big thank you to everyone who supported me here in the past. Due to my great experience, I would like to ask another question.


lets say I have the following:

Now I would like SmS to

  • calculate the average for New York only
  • calculate the average for all other cities combined
  • state: The average sales in New York: xxx
  • (="The average sales in New York: " + ??)
  • Plus: the result should not have more than 2 post decimal digits.

I guess I need a summary formula. something like "if location = "new york", avg sales ...


Thanks!!

Answers