finding average risk score
Hello,
I am trying to find the average risk score across multiple sheets given the criteria of being a risk and being open. I am trying to use an (AVG(COLLECT( but I am getting an invalid operation. Here is what I am trying:
=AVG((COLLECT({CA Risk Score}, {CA ROI Option}, "Risk", {CA Risk Status}, "Open") + COLLECT({CRV Risk Score}, {CRV ROI}, "Risk", {CRV Risk Status}, "Open") + COLLECT({HA Risk Score}, {HA ROI}, "Risk", {HA Risk Status}, "Open") + COLLECT({LEE Risk Score}, {LEE ROI}, "Risk", {LEE Risk Status}, "Open") + COLLECT({SSC Risk Score}, {SSC ROI}, "Risk", {SSC Risk Status}, "Open") + COLLECT({DTIM Risk Score}, {DTIM ROI}, "Risk", {DTIM Risk Status}, "Open")))
Best Answer
-
Try wrapping each of the individual AVG(COLLECT(....)) pieces in their own IFERROR function to output a zero in those instances where a sheet does not contain any matching rows.
Then you can wrap the whole thing in another IFERROR for when none of the sheets contain any rows to be included.
Answers
-
Try this instead:
AVG(AVG(COLLECT({CA Risk Score}, {CA ROI Option}, "Risk", {CA Risk Status}, "Open")), AVG(COLLECT({CRV Risk Score}, {CRV ROI}, "Risk", {CRV Risk Status}, "Open")), AVG(COLLECT({HA Risk Score}, {HA ROI}, "Risk", {HA Risk Status}, "Open")), AVG(COLLECT({LEE Risk Score}, {LEE ROI}, "Risk", {LEE Risk Status}, "Open")), AVG(COLLECT({SSC Risk Score}, {SSC ROI}, "Risk", {SSC Risk Status}, "Open")), AVG(COLLECT({DTIM Risk Score}, {DTIM ROI}, "Risk", {DTIM Risk Status}, "Open")))
-
Hey @Paul Newcome. Thank you! I get a #DIVIDE BY ZERO error I think because one of the sheets does not have anything that match the criteria. do you know how I could resolve this?
-
Try wrapping each of the individual AVG(COLLECT(....)) pieces in their own IFERROR function to output a zero in those instances where a sheet does not contain any matching rows.
Then you can wrap the whole thing in another IFERROR for when none of the sheets contain any rows to be included.
-
@Paul Newcome Thank you! That worked. Now I would like exclude zeros from being part of the average calculation... I tried doing this and it didnt work:
=IFERROR(AVERAGEIF(COLLECT({CA Risk Score}, {CA ROI Option}, "Risk", {CA Risk Status}, "Open")>0), 0)
-
You would still use an AVG/COLLECT combo (not the AVERAGEIF function), and you would include a range/criteria set where the range is the score range and the criteria is greater than zero.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.5K Get Help
- 424 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 145 Just for fun
- 62 Community Job Board
- 465 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 301 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!