Apply filters within a formula / IF statements?
Hello!
I am trying to apply some filters within a formula but I'm not quite sure which ones to use. I've tried using if, minimum, and a few others but it comes back as unparseable.
Column A = Person Name (values = Ann, Dan, Stan)
Column B = Event Type (values = Internal, External)
Column C = Cost (values = any amount in US dollars)
I am trying to return the minimum cost (column C) IF Column A = Ann AND Column B = Internal.
And once that works, would also want to calculate the average cost using the same filters (Column A / Person Name = Ann AND Column B / Event Type = Internal).
Best Answer

Minimum cost would be something like this...
=MIN(COLLECT([Column C]:[Column C], [Column A]:[Column A], @cell = "Ann", [Column B]:[Column B], @cell = "Internal"))
The average would look pretty much the same except for the main function:
=AVG(COLLECT([Column C]:[Column C], [Column A]:[Column A], @cell = "Ann", [Column B]:[Column B], @cell = "Internal"))
Answers

Minimum cost would be something like this...
=MIN(COLLECT([Column C]:[Column C], [Column A]:[Column A], @cell = "Ann", [Column B]:[Column B], @cell = "Internal"))
The average would look pretty much the same except for the main function:
=AVG(COLLECT([Column C]:[Column C], [Column A]:[Column A], @cell = "Ann", [Column B]:[Column B], @cell = "Internal"))

THANK YOU, @Paul Newcome !! This did the trick  you are a lifesaver!

Help Article Resources
Categories
Check out the Formula Handbook template!