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!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.5K Get Help
- 424 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 145 Just for fun
- 63 Community Job Board
- 465 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 301 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!