简体   繁体   English

Excel:复制单元格公式时为动态INDIRECT

[英]Excel: Dynamic INDIRECT when copying cell formula

I have the following formula 我有以下公式

=INDIRECT("'"&$A$1&"'!"&"D3")

in A1 I have the name of another sheet and this correctly goes to that sheet, cell D3 and return the value. 在A1中,我有另一个工作表的名称,它可以正确转到该工作表的单元格D3,并返回值。 Now I'd like to drag this formula on the cell below and be automatically updated to 现在,我想将此公式拖动到下面的单元格上,并自动更新为

=INDIRECT("'"&$A$1&"'!"&"E3")

then drag below again and have 然后再拖到下面

=INDIRECT("'"&$A$1&"'!"&"F3")

and so on... 等等...

is it possible or I have to manually change the cell? 有可能还是我必须手动更换电池? Is there another way? 还有另一种方法吗?

thanks 谢谢

To change the column reference as the formula is dragged down, use ADDRESS() which returns a string: 要在下拉公式时更改列引用,请使用ADDRESS()返回一个字符串:

=INDIRECT("'" & $A$1 & "'!"&ADDRESS(3,ROW(4:4)))

The ROW() will be Dynamic and refer first to the 4th Column, or "D" and as it is dragged down it will refer to the 5th then the 6th and so forth. ROW()将是动态的,并且首先引用第4列或“ D”,向下拖动时将引用第5列,然后引用第6列,依此类推。

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

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