Hide #INVALID DATA
Hello,
I am attempting to calculate the difference between two dates. When one of the dates is missing, the cell where the difference would be shown instead contains "#INVALID DATA".
Can anyone please help? I've attached a screenshot. The "Actual Duration" column is the difference between the "Start Date" and "End Date".Β I would like to have the cell in "Actual Duration" remain blank when the "End Date" cell is blank.
Thanks,
Jonny
Comments
-
Hi Jonny,
Does this work?
=IF(ISBLANK([End Date]1), " ", [End Date]1 - [Start Date]1)
Thanks,
Dave
Β
Β
-
You can also do this:Β
=IFERROR([End Date]1 - [Start Date]1, "")Β
And if you want to make that formula more independent use @row instead of a physical reference.Β
=IFERROR([End Date]@row - [Start Date]@row, "")Β
ForΒ more on these formulas see:Β
- https://help.smartsheet.com/function/iferror
- https://help.smartsheet.com/articles/2476491-create-efficient-formulas-with-at-cell#row
Β
-
Hi Mike,
Thanks for sharing the iferror function.Β I had never seen it before.Β That's the cool thing about the community, almost every time I share how I do something I learn that there's a better way!
Dave
-
You're welcome. It is fun to learn from others! I've done my fair share of learning these past couple of years.Β
Β I'm glad I can be an inspiration!Β
Β
Jonny, did either of our solutions work for you?Β