I would like to suggest an alternative method that also works with mutable unnamed ranges (for example, output from other functions, not just ranges existing in the spreadsheet). The general idea is to use FILTER () as an extraction mechanism, and build a vector of true / false values as an indicator of which rows to retrieve. So, for example, if the original range is A1: D13, and I want to extract line 7, I would write
=filter( A1:D13, {transpose(split(rept("0 ", 6), " ")); 1; transpose(split(rept("0 ", rows(A1:D13)-7), " ")) } )
As you can see, it also easily generalizes to extracting any number of rows from anywhere. In the general case, we construct the following formula:
=filter( <data>, {transpose(split(rept("0 ", <number rows to skip from the start>), " ")); transpose(split(rept("1 ", <number of rows to extract>), " ")); transpose(split(rept("0 ", <number of rows to skip until the end), " ")) } )
ttarchala
source share