简体   繁体   中英

Excel - Inserting cell value in formula column name

I have two sheets, in first sheet the linked references value are there in columnA which has random values like 7000, 231, 799 etc

I want to insert all those linked values from Sheet2 into column in sheet1,

so those values are accessible with these codes, for example if references values are 7000, 231,799 then

i can access the values from sheet to with this formula

=sheet2!B7000

=sheet2!B231

=sheet2!B799

so I am directly trying to put the value in formula like this

=sheet2!B<value of A1>
=sheet2!B<value of A2>
=sheet2!B<value of A3>

i tried so many things which gives me error with #NAME?

please suggest me a solution.

You can use INDIRECT

=INDIRECT("sheet2!b"&A1)

but I prefer to use INDEX because INDIRECT is volatile and gives you certain problems like always having to save the workbook whenever you close it

=INDEX(Sheet2!B:B,A1)

=INDIRECT ("sheet2!B"&sheet2!A1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM