简体   繁体   English

Excel-在公式列名称中插入单元格值

[英]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 我有两张纸,在第一张纸中,columnA中有链接的引用值,该值具有诸如7000、231、799等的随机值

I want to insert all those linked values from Sheet2 into column in sheet1, 我想将所有来自Sheet2的链接值插入到sheet1的列中,

so those values are accessible with these codes, for example if references values are 7000, 231,799 then 因此可以使用这些代码访问这些值,例如,如果引用值为7000、231,799,则

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? 我尝试了很多事情,这给我#NAME?带来了错误#NAME?

please suggest me a solution. 请给我建议一个解决方案。

You can use INDIRECT 您可以使用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,因为INDIRECT易变,并且会给您带来某些问题,例如始终必须在关闭工作簿时保存工作簿

=INDEX(Sheet2!B:B,A1)

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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