If criteria from 2 columns is met, pull the avg of a third column
I need the avg of the "% to complete" column if the "project" column is checked and the "Law" column = 1. It keeps giving a divide by zero error. When I tried it with count instead of avg, it is only showing a count of 1 even though many rows meet the criteria.
=AVG(COLLECT([% To Goal]:[% To Goal], Project:Project, =1, Law:Law, =1))
Thanks!
Answers
-
Your formula looks pretty good, I think the one thing that might be throwing the error is that when you have a criterion that looks at a checkbox column, you don't need the equals sign before the 1 or 0.
Try this:
=AVG(COLLECT([% To Goal]:[% To Goal], Project:Project, 1, Law:Law, =1))
Hope this helps!
-
Unfortunately, it is still showing a divide by zero error.
-
You need to remove the second '=' sign as well.
-
Still receiving the same error.
-
Hi @sammmm
As I tested, those formulas work.
=AVG(COLLECT([% To Goal]:[% To Goal], Project:Project, true, Law:Law, 1))
=AVG(COLLECT([% To Goal]:[% To Goal], Project:Project, true, Law:Law, 1))
=AVG(COLLECT([% To Goal]:[% To Goal], Project:Project, @cell = 1, Law:Law, =1))
The closest formula to yours is the last one, which I put @cell in front of "=1".
=AVG(COLLECT([% To Goal]:[% To Goal], Project:Project, =1, Law:Law, =1))
As you commented, removing "=" from the two "=1" did not work. I guess this is how Smartsheet checkbox boolean column works.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.1K Get Help
- 448 Global Discussions
- 154 Industry Talk
- 504 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 80 Community Job Board
- 513 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!