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
- 10.8K Get Help
- 65 Global Discussions
- 69 Industry Talk
- 385 Announcements
- 3.5K Ideas & Feature Requests
- 56 Brandfolder
- 125 Just for fun
- 50 Community Job Board
- 464 Show & Tell
- 40 Member Spotlight
- 44 Power Your Process
- 28 Sponsor X
- 234 Events
- 7.3K Forum Archives