Reputation: 45
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 |
--
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.
Upvotes: 2
Views: 382
Reputation: 2645
You may use either of the below:
Here, you have to drag down for the formula to populate below
=REGEXEXTRACT(A2,", (.*?) at")
while the code below, will automatically expand on the column
=ARRAYFORMULA(IF(A2:A="","",REGEXEXTRACT(A2:A,", (.*?) at")))
The formula, will take the characters after the first comma until 'at'.
Upvotes: 3