Finding the MIN of 2 dates from timeline column in formula column

Hi there! Still getting used to Monday, but I’m trying to use the formula column to return the earliest date from multiple timeline columns. I’ve tried minimum and >/< functions but some reason it’s not working. Likely something to do with my syntax but would appreciate help. I’ve checked a couple of seemingly similar posts but nothing seems to work.

Hi @CynthiaD,

As far as I know MIN only works with numbers. So you would need to use an If Statement

IF({Timeline1#Start}>{Timeline2#Start},{Timeline1#Start},{Timeline2#Start})

If you want to format it “YYYYMMDD”, then

IF({Timeline1#Start}>{Timeline2#Start},FORMAT_DATE({Timeline1#Start},"YYYYMMDD"),FORMAT_DATE({Timeline2#Start},"YYYYMMDD"))

Thanks @GCavin - let me try that. I thought as much with MIN function, the only problem is that I want to compare up to 5 date columns. I can write a very long if statement if thats the only way but I wanted to make sure first. Thanks again

Your other option is to convert the dates into a number, then to use MIN.

MIN(DATEVALUE(FORMAT_DATE({Timeline#Start})),DATEVALUE(FORMAT_DATE({Timeline1#Start}))

This is simpler if you have 5 dates.

You’ll get the first date formatted as a number. To get it back to a date you’ll need to use this syntax:

FORMAT_DATE(ADD_DAYS("1899-12-31",MIN(DATEVALUE(FORMAT_DATE({Timeline#Start})),DATEVALUE(FORMAT_DATE({Timeline1#Start})))-1.0001),"YYYYMMDD")

Refer to The monday Hidden Functions – The Monday Man for more details.

2 Likes

Thanks so much @GCavin !! Will try that today. Really appreciate it