We help IT Professionals succeed at work.

Copy and paste on certain cells based on index

christamcc
christamcc asked
on
Hello,
Here's the setup:

Sheet Two contains two rows of data.
Row 1 contains the index of the value in row 2, ex:
1           2        3         4     etc....
0.23    0.34   0.61    0.12

Sheet One has a row of indices, ex:
2     4     9    etc...

I need a script/formula to copy the values for the indices in Sheet Two to the appropriate indices in Sheet One, ex:
Sheet One after script:
2           4      etc....
0.34    0.12

Need more info?

Thanks!
Christa
Comment
Watch Question

Top Expert 2010

Commented:
Try hlookup:

=hlookup(a1,'sheet two'!$1:$2,2,false)
Analyst Assistant
Commented:
If you want a formula you could try INDEX:

=INDEX(Sheet2!$2:$2,, A1)

Author

Commented:
I forgot to mention that the index is not the header row and I could have multiple rows of indexes on a sheet, so HLOOKUP wouldn't work for my situation, but I was able to get INDEX to work.

Thanks!