Comparing dates

Hello everyone,

I have three date columns with individual dates. In a fourth column, I want to display the next upcoming date which is not in the past. In Excel, I would have used something like this:

=MIN(IF(A1:C1>=TODAY(),A1:C1))

I'm not sure how to achieve this in Smartsheet, especially when it comes to comparing columns.

Any help is highly appreciated! Thank you very much.

Tags:

Answers

  • Hi,

    assuming your columns are formatted as dates, the below formula would work

    =MIN(COLLECT([Date1]@row:[Date3]@row, [Date1]@row:[Date3]@row, >=TODAY()))

  • Thank you @Etienne F., that works!

    I was aiming for a formula which compares the dates independently from their position in the sheet as I have some columns in-between of the date columns.

    I came up with something like this:

    =MIN(IF(AND([Date1]@row >= TODAY(), [Date1]@row <> ""), [Date1]@row, ""), IF(AND([Date2]@row >= TODAY(), [Date2]@row <> ""), [Date2]@row, ""), IF(AND([Date3]@row >= TODAY(), [Date3]@row <> ""), [Date3]@row, ""))

    Can this be simplified?

  • no better idea at this point in time, but please note you can keep first formula if the columns in between are not dates. that would still work even if they're counted in the range of collect!