[英]Excel: Reference a formula in a cell from another worksheet where rows are added
help is appreciated on this topic! 感谢您提供有关此主题的帮助!
SUM(B1:OFFSET(B10,-1,0))
, which sums values from B1:B9. 单元格B10包含公式SUM(B1:OFFSET(B10,-1,0))
,该公式将B1:B9中的值相加。 I've tried using offset() and indirect() but haven't figured this out. 我试过使用offset()和indirect(),但还没有弄清楚。
Thanks for help! 感谢帮助!
There are (at least) two ways to handle this: 有(至少)两种方法可以解决此问题:
1) Every time you insert the row, make sure you place your cursor on the formula cell before manually inserting row. 1)每次插入行时,请确保在手动插入行之前将光标放在公式单元格上。 If you do, the formula in Sheet1!A1
will automatically follow suit, and you can add whatever you need in the new cell (created from the new row). 如果这样做, Sheet1!A1
的公式将自动跟随,您可以在新单元格(从新行创建)中添加所需的内容。 For example, inserting a row at B10
will adjust the formula in A1
to say =Sheet2!B11
. 例如,在B10
处插入一行将调整A1
的公式,使其表示=Sheet2!B11
。
2) Realizing that point 1 may not be suitable to your process, place this formula in Sheet1A1
: =OFFSET(Sheet2!B1,COUNT(Sheet2!B1:B100)-1,0)
2)意识到第1点可能不适合您的过程,请将此公式放在Sheet1A1
: =OFFSET(Sheet2!B1,COUNT(Sheet2!B1:B100)-1,0)
You can adjust the B100
to whatever you need. 您可以根据需要调整B100
。 Just be sure there's nothing in between the the final formula cell and the last row in the this formula range. 只要确保最终公式单元格与该公式范围的最后一行之间没有任何关系即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.