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
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!