Forum Discussion
Extract mm.yyyy from text
- Jan 22, 2026
=REGEXEXTRACT(A1, "\d{2}\.\d{4}")
Hello SDj1,
You can extract mm.yyyy from text in Excel in several ways, depending on your version:
- SEARCH + MID (works in all versions) =MID(A1, SEARCH("??.????", A1), 7)
- REGEXEXTRACT (Excel 365 only) =REGEXEXTRACT(A1, "\d{2}\.\d{4}")
- TEXTJOIN + MID + ROW (array formula) =TEXTJOIN("",,IF(ISNUMBER(--MID(A1,ROW($1:$50),7)),MID(A1,ROW($1:$50),7),""))
- TEXTBEFORE / TEXTAFTER (Excel 365 only) =TEXTBEFORE(TEXTAFTER(A1," "), " ")
- Power Query Load your column into Power Query → use Extract → Text Between Delimiters with “.” as delimiter → recombine left and right parts to form mm.yyyy..
- VBA Regex (works in all versions, requires macros) Function ExtractDate(txt As String) As String Dim RE As Object, matches As Object Set RE = CreateObject("VBScript.RegExp") RE.Pattern = "\b\d{2}\.\d{4}\b" RE.Global = True If RE.Test(txt) Then Set matches = RE.Execute(txt) ExtractDate = matches(0) Else ExtractDate = "" End If End Function
Then use =ExtractDate(A1) in your sheet.
Official Microsoft documentation for all these functions is available here: https://support.microsoft.com/en-us/office/excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188
For the cells where the month is written out as text (like “12 December 2024” or “19 June 2025”), you can normalize them in Excel 365 by extracting the part after “dated” and converting it into a proper date:
=DATEVALUE(TEXTAFTER(A1,"dated "))
This works even if the date is in the middle of the text. Once Excel recognizes it as a date, apply a custom number format:
mm.yyyy
That way, whether the source was 12.2024, 31.03.2025, or 19 June 2025, Excel will display it consistently as 12.2024, 03.2025, 06.2025, etc.