Search code examples
regexdateparsinggoogle-sheetsgoogle-sheets-formula

Google sheets: Parse date from text


Google Sheets - Parsing

From given text, how do you extract the date?

Given text Extracted date (to be generated)
Graduation reunion on Saturday, September 10, 2022 at 123 Front Street September 10, 2022
BBQ Party on Sunday October 1, 2022 at 213 South Street October 1, 2022

Google Sheets link

--

I've tried

=regexextract(A2,"\w{9} \d{2}, \d{4}")*1

As shown in the Google Sheets, this only works for the first one which is September 10, 2022. However, not all months have the same number of characters.


Solution

  • try:

    =INDEX(IFNA(REGEXEXTRACT(A2:A, "(\w+ \d+, \d{4})")*1))
    

    enter image description here