# How to select the Nth item in a list where N is stored in array B? [closed]

This post is a wiki. Anyone with karma >75 is welcome to improve it.

There are 100 cells in column A, each with a single (text) character. Column B contains 100 integers (N) in the range 1-100, with the possibility of duplications and with some numbers missing. I want each of 100 cells in column C to contain the contents of A as determined by each N in column B. eg. Col A contains a,b,c,d,e,f,g,h,...; Col B contains 1,2,3,5,4,4,1,1,...; Col C contains a,b,c,e,d,d,a,a,....

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by Alex Kemp close date 2020-09-12 13:30:12.193779

Sort by » oldest newest most voted

If your 100 is actually a fix number, and the texts in column A also start with the first row as the contents in column B do, you may use =INDEX($A1:$A100;$B1) in cell C1 and fill the formula down till C100. Regard the difference between absolute and relative addresing! Only the 1 of the cell addres $B1 in the formula above is relative.

This is a rather raw method. If you want to be more flexible use the OFFSET function. Feel free to come back with additional questions in this case.

(Generally: You may want to read the Calc guide. With respect to your question the versions do not differ.)

more

Thanks. I found that "=INDEX($A$1:$A$100,\$B1)" worked well.

( 2016-09-16 15:29:39 +0100 )edit

Of course. The question is if it will still work well after some enhancements to / scaling up / adaptions of / ... your sheets. OFFSET can take parameters controlling the size of the data range, e.g.
(You may check the 'Solved' mark next to the answer.)

( 2016-09-16 17:36:36 +0100 )edit