How can I use row values to index into another sheet?

alpha    | 0.1
beta     | 0.2
gamma    | 0.3
delta    | 0.4
epsilon  | 0.5

and another sheet in the same file, Data Subset, that holds an arbitrary number of row indices to the first sheet. E.g.:

2
4
5

What formula could I put in Data Subset that would allow me to pull data from the rows indicated by the first column?

e.g.:

2 | beta     | 0.2
4 | delta    | 0.4
5 | epsilon  | 0.5
• I wasn't successful in creating a formula that uses ARRAYFORMULA or VLOOKUP. I hope that particular solution will come eventually. Dec 26 '13 at 21:12
• @JacobJanTuinstra I hope so too. Your formula examples work, but only when exactly 3 rows index exactly 2 columns. I will post a scalable solution if I find one. Dec 28 '13 at 0:08

I found three solutions for you.

Formula

=INDIRECT("DATA!A"&A1) function dataSubset(data,subset) {
var output = [];
for(var i=0, iLen=subset.length; i<iLen; i++) {
for(var j=1, jLen=data.length+1; j<jLen; j++) {
if(parseInt(subset[i]) == parseInt(j)) {
output.push(data[j-1]);
}
}
}
return output;
} =ARRAY_ROW(INDIRECT("DATA!A"&A1),INDIRECT("DATA!B"&A1))

Example

I've prepared two example files for you:

You can simply use the index function.

In B1 enter:

=INDEX(Data!A\$1:A\$5,\$A1)

then you can copy and paste this to the rest of the cells in columns B and C