简体   繁体   English

在Excel中引用

[英]Referencing in Excel

I want to reference this cell in another worksheet for my current worksheet, which is calculated by 我想在我的当前工作表的另一个工作表中引用此单元格,该工作表由计算

=[2015_RunRate.xlsx]January!$C$66

However, I want to replace the word "January" in that reference with the value from cell C19 in my current worksheet. 但是,我想用当前工作表中单元格C19中的值替换该引用中的单词“January”。

I tried something along the lines of: 我尝试过以下方面:

=([2015_RunRate.xlsx])([Current_Worksheet.xlsx]!$C$19)!$C$66

That clearly didn't work. 这显然不起作用。 Any ideas? 有任何想法吗?

Thanks. 谢谢。

You can use the INDIRECT function to convert a string you've stitched together into a valid cell reference. 您可以使用INDIRECT函数将已拼接的字符串转换为有效的单元格引用。

=INDIRECT("[2015_RunRate.xlsx]"&$C$19&"!C66")

The INDIRECT function cannot reference a closed workbook. INDIRECT函数无法引用已关闭的工作簿。 It is also considered a volatile¹ function. 它也被认为是挥发性的¹功能。 Since C66 is now nothing but text that looks like a cell reference, there is no need to add the absolute row and column indicators (eg $ ). 由于C66现在只是看起来像单元格引用的文本,因此无需添加绝对行和列指示符(例如$ )。 The text will not change when moved or copied to another location. 移动或复制到其他位置时,文本不会更改。


¹ Volatile functions recalculate whenever anything in the entire workbook changes, not just when something that affects their outcome changes. ¹ 当整个工作簿中的任何内容发生变化时,不仅在影响其结果的某些内容发生变化时,易失性函数都会重新计算。 Examples of volatile functions are INDIRECT , OFFSET , TODAY , NOW , RAND and RANDBETWEEN . 易失性函数的示例是INDIRECTOFFSETTODAYNOWRANDRANDBETWEEN Some sub-functions of the CELL and INFO worksheet functions will make them volatile as well. CELLINFO工作表函数的某些子函数也会使它们变得不稳定。

You can use Indirect function. 您可以使用间接功能。 Eg: 例如:

INDIRECT("[Book2.xlsx]"&B1&"!$A$1")

Where B1 is a cell containing text string with name of a sheet in the other workbook. 其中B1是包含文本字符串的单元格,其中包含另一个工作簿中的工作表名称。 Like "January", "February", etc. 像“一月”,“二月”等

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

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