# Do not want Cells with "N/A" figured in my formula

edited 12/09/19

=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?

• Employee

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!

Genevieve

Join us at Smartsheet ENGAGE 2024 🎉
October 8 - 10, Seattle, WA | Register now

• ✭✭✭✭✭✭

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")

• Employee

These are great solutions, Paul!

Join us at Smartsheet ENGAGE 2024 🎉
October 8 - 10, Seattle, WA | Register now

• ✭✭✭✭✭✭

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.

• Employee

Haha, no thunder stolen here.

Join us at Smartsheet ENGAGE 2024 🎉
October 8 - 10, Seattle, WA | Register now

• It works great!!  Thanks to Genevieve and Paul "The Thunder Stealer"

• ✭✭✭✭✭✭

Haha!!! Happy to help!

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!