Search code examples
filtersplitgoogle-sheets-formulamatchdelimited

Extract nth element from comma-delimited list with Google Sheets formula


I have a string:

"apple12,bear23,chile,dormir45,elephant"

I'd like to use the regexextract() formula to get the nth element from this list, where n is going to be a row() in an arrayformula. I just need the regex where I can input a number {1}, {2}, {3}, etc.

Workbook to help: https://docs.google.com/spreadsheets/d/1zAf41twr_JCkZ44Qo5j73WrWhXDc2KoOo3UI4RpyUI8/edit?usp=sharing

I realize this is probably possible with =SUBSTRING() as well.


Solution

  • use:

    =INDEX(SPLIT(A1, ","),, B2)
    

    where B2 is value with position

    enter image description here