Help

Re: How do I return nothing when a field is empty as opposed to "#ERROR"?

2576 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Greg_Maye
5 - Automation Enthusiast
5 - Automation Enthusiast

When my Birthday field is empty, how do I get Age to show nothing as opposed to “#ERROR”? Here is my formula at this point:

DATETIME_DIFF(TODAY(), {Birthday}, ‘years’)

Thanks for any help given.

13 Replies 13
Britt_Myers
5 - Automation Enthusiast
5 - Automation Enthusiast

This is a great tip, although I’m still not quite able to do what I want.

WORKDAY({Icon Start}, 3) is my formula for adding 3 work days to the date in Icon Start. This returns an error if the Icon Start date is null, which it often is.

So I wrapped it in an IF as mentioned above:

IF({Icon Start},WORKDAY({Icon Start}, 3),0)

But now, the result of WORKDAY({Icon Start}, 3) is no longer a date that can be formatted, but rather a string, showing: May 20, 2019 2019-05-23T00:00:00.000Z

Is there a way to hide the #ERROR but also return a formatted date in the cell?

Thanks!

Hi

All you need to do is to remove the ‘, 0’ from the IF - with 0 as one of the possible returned values, Airtable cannot interpret the result of the formula as definitely a date and so displays is as a text field. You will also find you will be able to use the format option on the result.

Hope this helps,

Julian

Brilliant, thanks! That worked great.

Lee-Ellen_Marvi
4 - Data Explorer
4 - Data Explorer

I don’t normally write code of any kind but can sometimes manage a cut-n-paste approach. Thanks to this thread, and with experimenting, I managed to create this formula for my time sheet (after months of putting in fake times). Thanks for the help!

IF({Start},DATETIME_DIFF(End, Start))+IF({Start 2},DATETIME_DIFF({End 2},{Start 2}))+IF({End 3},DATETIME_DIFF({End 3},{Start 3}))

The time sheet allows for coming and going up to three times during the day.