Average of values if criteria is met in two other columns

Hello, I am trying to determine the average of values in one column (Days Open) if criteria in two other columns is met:

  1. (Date Closed) is from last month
  2. (Facility Name) is a specific dropdown option from this column

I can calculate average based upon date closed being from last month, but adding in the second criteria that the facility name from that row is specific text is giving me issue.

=AVERAGEIF(COLLECT({Days Open}, {Date Closed}, IFERROR(MONTH(@cell ), 0) = MONTH(TODAY()) - 1, {Facility}, FIND("NAME", @cell)))

Best Answer

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭
    Answer ✓

    Hey @shoey24

    Change your AVERAGEIF to AVG. The COLLECT function is filtering the same as the IVERAGEIF function would

    =AVG(COLLECT({Days Open}, {Date Closed}, IFERROR(MONTH(@cell ), 0) = MONTH(TODAY()) - 1, {Facility}, FIND("NAME", @cell)))

    Will this work for you?
    Kelly

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!