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

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    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"))

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!