Error formula to also include blanks for zeros
Hi - I currently have a formula wrapped with the IFERROR to return blank if an error is calculated. I would also like it to be wrapped to return a blank for zeros as well. Any thoughts? Here is my formula:
=IFERROR(COUNTIFS({OS}, OS@row, {Level}, "Unify", {Project Status}, "Complete", {Project Type}, "Database", {Completion Date}, AND(IFERROR(YEAR(@cell), "") = PK$13)), "")
Answers
-
Try something like this...
=IFERROR(IF(COUNTIFS({OS}, OS@row, {Level}, "Unify", {Project Status}, "Complete", {Project Type}, "Database", {Completion Date}, AND(IFERROR(YEAR(@cell), "") = PK$13) > 0, COUNTIFS({OS}, OS@row, {Level}, "Unify", {Project Status}, "Complete", {Project Type}, "Database", {Completion Date}, AND(IFERROR(YEAR(@cell), "") = PK$13))), "")
-
Hi Paul - thanks. I tried this, but I'm getting a #incorrect argument set error.
-
Ok. Here is the idea behind it (and I will redo it in steps this time to make sure I didn't miss something the first time).
First we take your original COUNTIFS:
COUNTIFS({OS}, OS@row, {Level}, "Unify", {Project Status}, "Complete", {Project Type}, "Database", {Completion Date}, AND(IFERROR(YEAR(@cell), "") = PK$13))
And now I see a little tweak to be made. We don't need the AND statement, so here it is trimmed down a touch...
COUNTIFS({OS}, OS@row, {Level}, "Unify", {Project Status}, "Complete", {Project Type}, "Database", {Completion Date}, IFERROR(YEAR(@cell), "") = PK$13)
Now we take our COUNTIFS and say that if it is greater than zero, run it. Leaving the 3rd portion of the IF statement out will automatically generate a blank for anything that is not greater than zero.
IF(COUNTIFS({OS}, OS@row, {Level}, "Unify", {Project Status}, "Complete", {Project Type}, "Database", {Completion Date}, AND(IFERROR(YEAR(@cell), "") = PK$13)) > 0, COUNTIFS({OS}, OS@row, {Level}, "Unify", {Project Status}, "Complete", {Project Type}, "Database", {Completion Date}, AND(IFERROR(YEAR(@cell), "") = PK$13)))
Now we drop that back into the IFERROR statement, and that should be working.
=IFERROR(IF(COUNTIFS({OS}, OS@row, {Level}, "Unify", {Project Status}, "Complete", {Project Type}, "Database", {Completion Date}, AND(IFERROR(YEAR(@cell), "") = PK$13)) > 0, COUNTIFS({OS}, OS@row, {Level}, "Unify", {Project Status}, "Complete", {Project Type}, "Database", {Completion Date}, AND(IFERROR(YEAR(@cell), "") = PK$13))), "")
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.4K Get Help
- 364 Global Discussions
- 201 Industry Talk
- 430 Announcements
- 4.4K Ideas & Feature Requests
- 137 Brandfolder
- 129 Just for fun
- 128 Community Job Board
- 446 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 284 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!