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
- Customer Resources
- 64.6K Get Help
- 433 Global Discussions
- 136 Industry Talk
- 466 Announcements
- 4.9K Ideas & Feature Requests
- 143 Brandfolder
- 147 Just for fun
- 63 Community Job Board
- 466 Show & Tell
- 32 Member Spotlight
- 2 SmartStories
- 298 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!