Help

formula to determine the max of multiple date values

Topic Labels: Dates & Timezones Formulas
Solved
Jump to Solution
1322 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Mike_Buck
6 - Interface Innovator
6 - Interface Innovator

I have a formula that works as is today, but I'm trying to add a condition to it and it keeps erroring out?  Was hoping to get some extra eyes on it?

What we're doing today is taking 3 different date fields, convert them to a #, and then display the max of the 3 fields.  This might be a weird way to get where we need to go, but it has worked for us.  All the "correct" fields are date fields in our base.

Formula today:

IF(
   OR({Correct Lift + 45}, {Correct Clamp + 45}, {Correct Date Mod}), 
   DATETIME_PARSE(
      MAX(
         IF({Correct Lift + 45}, VALUE(DATETIME_FORMAT({Correct Lift + 45}, 'YYYYMMDD'))), 
         IF({Correct Clamp + 45}, VALUE(DATETIME_FORMAT({Correct Clamp + 45}, 'YYYYMMDD'))), 
         IF({Correct Date Mod}, VALUE(DATETIME_FORMAT({Correct Date Mod}, 'YYYYMMDD')))
      ), 
      'YYYYMMDD'
   )
)
 
So what I'm wanting to do is add a 4th date into the equations, so wouldn't my new formula be:
 
IF(
   OR({Correct Lift + 45}, {Correct Clamp + 45}, {Correct Date Mod},{New Value}), 
   DATETIME_PARSE(
      MAX(
         IF({Correct Lift + 45}, VALUE(DATETIME_FORMAT({Correct Lift + 45}, 'YYYYMMDD'))), 
         IF({Correct Clamp + 45}, VALUE(DATETIME_FORMAT({Correct Clamp + 45}, 'YYYYMMDD'))), 
         IF({Correct Date Mod}, VALUE(DATETIME_FORMAT({Correct Date Mod}, 'YYYYMMDD'))),
         IF({New Value}, VALUE(DATETIME_FORMAT({New Value)},'YYYYMMDD')))
      ), 
      'YYYYMMDD'
   )
)
 
 
But I'm getting an error?

 

 

1 Solution

Accepted Solutions
Sho
11 - Venus
11 - Venus

Looks like there's an extra ")" in there.
{New Value)} -> {New Value}

IF({New Value}, VALUE(DATETIME_FORMAT({New Value},'YYYYMMDD')))

 

See Solution in Thread

3 Replies 3
Sho
11 - Venus
11 - Venus

Looks like there's an extra ")" in there.
{New Value)} -> {New Value}

IF({New Value}, VALUE(DATETIME_FORMAT({New Value},'YYYYMMDD')))

 

shubhams021
5 - Automation Enthusiast
5 - Automation Enthusiast

Where are you writing this syntax in airtable. I am not able to do such type of things @Sho 

Mike_Buck
6 - Interface Innovator
6 - Interface Innovator

Thank you!