Forum Discussion

Clive_Rabson's avatar
Clive_Rabson
Brass Contributor
May 24, 2024
Solved

Comparing dates

I have a simple spreadsheet, consisting of three columns.

Col A         Col B          Col C

Date1        Date2        EarliestDate

I need help with a formula in Col C (EarliestDate) that must display the earliest date either in Col A or B.

My formula below shows as too many arguments. 

I tried this but no good:

"=IF(AND(Date1="",Date2=""),"none",IF(Date1=Date2,Date1,IF(Date2="",Date1,Date2),IF(Date1<Date2,Date1,Date2))))"

Any ideas please from you experts?

 

Versions:

Mac OS 10.15.7 (Catalina)

Word 16.66.1

Excel 16.66.1

4 Replies

  • dscheikey's avatar
    dscheikey
    Bronze Contributor

    Clive_Rabson 

     

    That should provide the solution:

    =IF(AND(Date1="",Date2=""),"none",MIN(Date1,Date2))

     

    • Clive_Rabson's avatar
      Clive_Rabson
      Brass Contributor

      dscheikey 

      Incidentally. What would you suggest for stopping "#N/A" or "#NUM!" showing?

      It is because some of the cells in the date columns have #N/A or #NUM! in them

      • dscheikey's avatar
        dscheikey
        Bronze Contributor

        Clive_Rabson 

        You can use the IFERROR() function.

         

        =IFERROR(IF(AND(Date1="",Date2=""),"none",MIN(Date1,Date2)),"none")

         

Resources