Combining IF and AVG help
Hello,
I am trying to combine these two functions to find an average number but only if it meets a specific criteria. For example, I have cases worked that can be canceled for 3 reasons. If the case is canceled because of a "No contact" with the client, I need to know the average number of days the case was active before it was canceled.
I've tried 7 different degrees of IF/AVG formulas to no avail. It either comes back as unparseable or invalid data type.
Comments
-
Can you share all the criteria or examples of your formulas that aren't working? It is a bit hard to visualize what you are looking for exactly.
-
Definitely!
I've tried =IF({Canceled Cases - Internal Training 2019 Range 1}, "Canceled Auto Response - Duplicate", AVG({Canceled Cases - Internal Training 2019 Range 2}))
This returns an invalid data type
If I use =AVG(IF({Canceled Cases - Internal Training 2019 Range 1},"Canceled Auto Response - Duplicate",){Canceled Cases - Internal Training 2019 Range 2})
This returns and #unparseable
I've tried several variations of these and am stumped.
-
The criteria for an IF statement cannot reference a range. You need to instead use the collect formula
Current formula
=IF({Canceled Cases - Internal Training 2019 Range 1}, "Canceled Auto Response - Duplicate", AVG({Canceled Cases - Internal Training 2019 Range 2}))
Adjusted formula
=avg(collect({Canceled Cases - Internal Training 2019 Range 2},{Canceled Cases - Internal Training 2019 Range 1},@cell = "Canceled Auto Response - Duplicate"))
Untested so there may be a typo
-
As a side note, you really should name your ranges instead of letting smartsheet name them for you. This will let you know exactly what you are referencing just by looking at the formulas. Also, the collect formula can be a bit difficult to grasp the concept of. I recommend perusing the formula webpage to learn a little about what it does
https://help.smartsheet.com/function/collect
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 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