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.

Upvotes: 4

Views: 4023

Answers (2)

player0
player0

Reputation: 1

use:

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

where B2 is value with position

enter image description here

Upvotes: 6

From @Dhiraj:

Try "=INDEX(SPLIT(B4,","),0,1)" so it will split data as row and provide u value of the given position. =INDEX(SPLIT(,","),0,)

Upvotes: 1

Related Questions