Home > database >  Pulling a set up cells from vertical list with a starting point and putting them in a horizontal lis
Pulling a set up cells from vertical list with a starting point and putting them in a horizontal lis

Time:01-20

I have a list that I made making vertically. I want to pick any point on the list - grab that and the next 4 in the list and place them horizontally in another list. I am just trying to figure out the most efficient way without adding complexity. Here is the list:

enter image description here

And this is what I want the output to be (with the choice of F): enter image description here

I have been tried to figure out how to do it with an index-match and with a vlookup and it just becomes to complex because I add so much to make it work.

CodePudding user response:

You can try the following in cell D2:

=TOROW(INDEX(A2:A18, SEQUENCE(5,,XMATCH(B1, A2:A18))))

or using LET to avoid repetition:

=LET(x, A2:A18, TOROW(INDEX(x, SEQUENCE(5,,XMATCH(B1, x)))))

Here is the output: excel output

  • Related