Forum Discussion
Clive_Rabson
May 24, 2024Brass Contributor
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
- dscheikeyBronze Contributor
- Clive_RabsonBrass Contributor
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
- dscheikeyBronze Contributor
You can use the IFERROR() function.
=IFERROR(IF(AND(Date1="",Date2=""),"none",MIN(Date1,Date2)),"none")
- Clive_RabsonBrass Contributor