When COUNTIF returns a "0" qty. show cell as blank
I am using this formula to count how many cells in a row have their checkbox checked, and it is working correctly. When the total = 0, I would like for the cell to appear blank instead of showing 0. I have tried nesting with an IF but I can't seem to get it to work.
=COUNTIF(Manufacturer@row:[Asset Tag #]@row, 0)
Any help would be appreciated.
Best Answer
-
@Jamy Crum this should do the trick..
=If(COUNTIF(Manufacturer@row:[Asset Tag #]@row, 0)=0,"",COUNTIF(Manufacturer@row:[Asset Tag #]@row, 0))
Basically
If the Count if = 0 then put "" in the column, else use the countif
Another simple trick to do if you are ever trying to do the math on the column and the mix of text and numbers causes issues
Example: 6+""+7+8+"" = #UNPARSEABLE
is to create a conditional format where you set the font to white on white if the value is zero. That way the math is still done but the user doesn't see the value. Could be a bit quicker to execute in the long run but we are probably talking milliseconds
Brent C. Wilson, P.Eng, PMP, Prince2
Facilityy Professional Services Inc.
http://www.facilityy.com
Answers
-
@Jamy Crum this should do the trick..
=If(COUNTIF(Manufacturer@row:[Asset Tag #]@row, 0)=0,"",COUNTIF(Manufacturer@row:[Asset Tag #]@row, 0))
Basically
If the Count if = 0 then put "" in the column, else use the countif
Another simple trick to do if you are ever trying to do the math on the column and the mix of text and numbers causes issues
Example: 6+""+7+8+"" = #UNPARSEABLE
is to create a conditional format where you set the font to white on white if the value is zero. That way the math is still done but the user doesn't see the value. Could be a bit quicker to execute in the long run but we are probably talking milliseconds
Brent C. Wilson, P.Eng, PMP, Prince2
Facilityy Professional Services Inc.
http://www.facilityy.com
-
Excellent! That seemed to do the trick.
I wasn't thinking that I could do another COUNTIF nested with the IF. Thanks for the additional tips when mixing text and numbers. I'm sure I'm going to run into that down the road.
Thank you so much for your help.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64K Get Help
- 410 Global Discussions
- 220 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 137 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!