Search code examples
regexdategoogle-sheetsgoogle-sheets-formulaarray-formulas

How to extract only date from Google Sheets cell


I'm trying to extract only the date from this cell which says: Current day (1 Nov 2019) Using:

=regexextract(concatenate(FullReport!B5),".*Current day(.*)")

Can't seem to figure out how to remove the brackets ( ) which I believe is causing it to not register in google sheets as an actual date.


Solution

  • to extract:

    =REGEXEXTRACT(A1, "\((.+)\)")
    

    0

    while true date would be:

    =ARRAYFORMULA(JOIN("/", 
     IFERROR(REGEXEXTRACT(A1, "\((\d+) (.+) (\d+)")*1, 
       MONTH(REGEXEXTRACT(A1, "\((\d+) (.+) (\d+)")&1))))
    

    0

    or just:

    =REGEXEXTRACT(A1, "\((.+)\)")*1