Do not want Cells with "N/A" figured in my formula
=SUM(CHILDREN()) / (COUNT(CHILDREN()) + COUNTIF(CHILDREN(), ""))
I am using the above formula for percent complete in my project plan as seen by my picture. My question is when certain parts of the project have not been started yet how do you exclude the cell with the "N/A" value in it from being calculated?
Comments
-
Hi Jason,
What if you adjusted your formula to as follows:
=SUM(CHILDREN()) / (COUNT(CHILDREN()) - COUNTIF(CHILDREN(), ="N/A"))
This would add the values of your child rows together, then it would divide that number only by the cells with an actual percentage value. This would also skip over any blank cells though, and not include those in the division calculation.
Were you looking to add in blank cells as if they were 0 percentage? If so, you could take away the N/A cells like so:
=SUM(CHILDREN()) / ((COUNT(CHILDREN()) - COUNTIF(CHILDREN(), ="N/A")) + COUNTIF(CHILDREN(), ""))
See my example image of both formulas, below.
Cheers!
GenevieveNeed more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Another option would be:
.
=SUMIFS(CHILDREN(), CHILDREN(), @cell <> "N/A") / COUNTIFS(CHILDREN(), @cell <> "N/A")
.
This provides the sum of the children that are not "N/A" and divides it by the count of the children that are not "N/A". This also includes the children that are blank as you did in your formula. It will sum/count every child that is NOT "N/A".
-
Thanks Genevieve, I used your formulas and they work unless there is one child. If there is one child under the parent and a "N/A" is present I get the error that I have divide by zero. Any suggestions on a workaround for that?
-
You would want to include an IFERROR statement to replace the error with what you want displayed.
=IFERROR(original formula, "display this if there is an error")
-
These are great solutions, Paul!
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Thanks, Genevieve!
I wasn't trying to steal your thunder. I just know you all keep pretty busy and wasn't sure when you would be able to respond.
-
Haha, no thunder stolen here.
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
It works great!! Thanks to Genevieve and Paul "The Thunder Stealer"
-
Haha!!! Happy to help!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 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!