Formula result is not a date

Hi guys,

The result of my formula is not recognised as a date…

Here’s what the formula’s supposed to do:
Firts I set the project deadline date. To execute the project a few actions needs to be done. I made a single selection field to choose how much days or weeks in advance the action needs to be done. For example “1 week” in advance. The formula I created is fairly simple:

[Deadline date] - [Select time] = New date

This is the code I made:

IF({Select time} = “1 week”, DATETIME_FORMAT(DATEADD({Deadline date}, -7, ‘days’), “DD/MM/YYYY”)

Can anybody help me so that my result is recognised as a date? I tried leaving out the " " but it gave me an error.

Thanks!

If {Deadline Date} is already recognized as a date, try removing the DATETIME_FORMAT() function, and see if the output returns a date

2 Likes

Yes, as @Kamille_Parks says, this will be a date type:

IF(
  {Select time} = '1 week', 
  DATEADD({Deadline date}, -7, 'days')
)
1 Like

Yup… that did the trick.
Thank you guys a lot!