Help

Re: Error in cells where date is missing in formula

1988 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Lindsey_Garvey
4 - Data Explorer
4 - Data Explorer

Hi there,

I know this question has been asked previously, and I realise there’s resources to give an idea, I’m just new to Airtable formulas, and still can’t make it work for me.

My question is super simple. I have a ‘date’ column, and then a column with formula to add 30 days. It then produces an error in all of the cells where the ‘date’ column hasn’t been populated. I realise I need to use ‘IF’… but struggle from there. I’ve tested out examples that I’ve seen, but no luck.

Thank you!

5 Replies 5
Carl
6 - Interface Innovator
6 - Interface Innovator

You can do something like,

IF(date=blank(),“”,[your +30 formula])

e.g.

IF(
  date=BLANK(),
  "",
  DATETIME_FORMAT(
    DATEADD(
    date,
    30,
    'day'
  ),
  'MM-DD-YYYY'
  )
)

Your formula could be simpler.

IF(
    {date},
    DATEADD( {date}, 30, 'days')
)
Carl
6 - Interface Innovator
6 - Interface Innovator

Good point. I had to use BLANK() for something that wouldn’t work like that, and it’s just became a default of mine. But when I did the DATEADD without formatting, it did not keep the {date} formatting.

If you use DATEADD() by itself, you get a date object. If the only thing the formula returns is a date object, then you set formatting in the formula formatting options. If you want to combine the date with other text, or if the formula could return text, that’s when you use DATETIME_FORMAT().