Google-sheets – Extracting range from of an array

google sheetsgoogle-sheets-arrayformulagoogle-sheets-query

From the following single cell array:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34

I'd like to extract 3,5,8,13,21 into a single cell by specifying index 4 : index 8 of the split of that cell.

The Challenge is that I'll need it be in a single step (cannot split array into different cells, as these arrays will get very long and will otherwise produce far too many cells for google sheets to handle.

I appreciate the help!

Best Answer

To get the desired result from your example in just one formula please try the following:

=REGEXREPLACE(JOIN(", ",TRANSPOSE(QUERY(TRANSPOSE(SPLIT(A1,",",true)),"select * offset "&8-4&" "))),"(, \d+$)","")

(assuming A1 holds your numbers)

I hope this is what you are looking for. If not let us know.