I have a column with values as diverse as:
- “28/09/2023”
- “23-Aug-24”
- “Completed by Treescape 10/4/24”
- “Completed November 23”
- “Completed by Treeserve”
- “Completed WE 2023 10 06”
- “To be completed by Summit between 31/10/23 & 10/11/23 as quoted works
RFQ2” - “Completed by Summit Vendor Panel 6”
And I would like to extract the date, when there is a date. Note that:
- Sometimes it’s just the date, other times there’s extra text
- Sometimes there’s two dates (I just want the first, or second, either is fine)
- Sometimes the month is 08, other times it may be Aug
- Sometimes there’s a number but it’s not the date
- Date could appear anywhere in the string
- Sometimes there’s ‘/’, others are ‘-‘, even spaces are used
- Sometimes it’s DAY MONTH YEAR, others it’s YEAR MONTH DAY
So far I’ve got some poor regex but it doesn’t work in lots of scenarios:
=REGEX(D2,"(d{1,2})[/-s](d{1,2}|D{3})[/-s](d{2,4})")
1