CountIF, AND, OR, & NOT Statements -- Which Order?
Hi! Was hoping someone might be able to provide some insight here. I am trying to work out a status formula where a percentage is calculated based on row values that have text in them. This would also be dependent on different status within the same row. Here's what I've worked out so far.
=COUNTIF([GMB URL]@row:[GMB Status]@row, OR(@cell = true, ISTEXT(@cell), AND([GMB Status]@row = "Published", NOT([GMB Status]@row = "Not Started"), OR([GMB Status]@row = "Canceled")))) / 3
The formula works, but the problem is that I do not want to calculate the percentage when a project is "Not Started", and I'm not sure where to but the following part of the formula without it still calculating the percentage (33% for all not started projects)
NOT([GMB Status]@row = "Not Started")
Any ideas!?
Best Answer
-
Your check for Not Started should be first. Like this:
=IF([GMB Status]@row = "Not Started", 0, COUNTIF([GMB URL]@row:[GMB Status]@row, OR(@cell = true, ISTEXT(@cell), AND([GMB Status]@row = "Published", NOT([GMB Status]@row = "Not Started"), OR([GMB Status]@row = "Canceled")))) / 3)
I hope this helps.
Cheers,
Ramzi
Ramzi Khuri - Principal Consultant @ Cedar Tree Consulting (www.cedartreeconsulting.com)
Feel free to email me: ramzi@cedartreeconsulting.com
💡 If this post helped you out, please help the Community by marking it as the accepted answer/helpful.
Answers
-
Your check for Not Started should be first. Like this:
=IF([GMB Status]@row = "Not Started", 0, COUNTIF([GMB URL]@row:[GMB Status]@row, OR(@cell = true, ISTEXT(@cell), AND([GMB Status]@row = "Published", NOT([GMB Status]@row = "Not Started"), OR([GMB Status]@row = "Canceled")))) / 3)
I hope this helps.
Cheers,
Ramzi
Ramzi Khuri - Principal Consultant @ Cedar Tree Consulting (www.cedartreeconsulting.com)
Feel free to email me: ramzi@cedartreeconsulting.com
💡 If this post helped you out, please help the Community by marking it as the accepted answer/helpful.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!