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.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!