Search code examples
arraysregexgoogle-sheetsgoogle-sheets-formulaextract

Pulling certain data information out of a Cell


Cheetah Piss - (3.5g) - Artizen

Trying to use a function that would be able to locate the information inside of the () so in this case is a 3.5g. I can't seem to get a function to pull it, I've gotten some to do close or 1 half.


Solution

  • use regex:

    =REGEXEXTRACT(A1; "\((.*)\)")
    

    enter image description here

    for array:

    =ARRAYFORMULA(IFERROR(REGEXEXTRACT(A1:A; "\((.*)\)")))
    

    .        - one single character
    .*       - all of it
    (.*)     - get everything
    \(       - escaped parenthesis
    \)       - escaped parenthesis
    \((.*)\) - get everything inside parenthesis