简体   繁体   English

Excel公式-修复多个工作表中的单元格引用

[英]Excel formula - fixing cell reference across multiple worksheets

This is a question for Excel. 这是Excel的问题。 I have to create similar tables in several worksheets. 我必须在几个工作表中创建类似的表。 But the tables are not matched up in terms of the row numbers. 但是表的行号不匹配。 For example, table in worksheet one starts on row 48; 例如,工作表1中的表从第48行开始; table in worksheet two starts on row 35, etc. Each table refers to a cell that is 3 rows above the table starts and needs to be fixed for the length of the table. 工作表中的两个表从第35行开始,依此类推。每个表都引用一个单元格,该单元格在表的开始位置高3行,并且需要针对表的长度进行固定。 So, in table in worksheet one, the formula needs to refer to cell M45 (three rows above 48); 因此,在工作表一的表中,该公式需要引用单元格M45(48上方的三行); in table in worksheet two, the formula needs to refer to cell M32 (three rows above 35); 在工作表二的表中,该公式需要引用单元格M32(35上方的三行); and so on. 等等。 If it were just one worksheet, I know that I could fix 32 and refer to M$45. 如果只是一个工作表,我知道我可以修复32个并参考M $ 45。 But I do not know how to automate it for the problem described above. 但是我不知道如何针对上述问题自动执行它。 The formula I need to automate is: 我需要自动化的公式是:

IF(SUM($L49:$L$61)>=M$45,0,MIN($L48,M$45)) . IF(SUM($L49:$L$61)>=M$45,0,MIN($L48,M$45))

M$45 needs to be M$32 in worksheet two when I copy the formula over from worksheet one to worksheet two. 当我将公式从第一工作表复制到第二工作表时,第二工作表中的M $ 45必须为第二工作表中的M $ 32。 The other references will also need to be modified accordingly. 其他参考也将需要相应地修改。 But once I know how to do one, I can take care of the rest. 但是一旦我知道该怎么做,我就可以照顾其余的人。 Would appreciate any help you can provide. 希望您能提供任何帮助。

If you use the following inside the table, 如果您在表格中使用以下内容,

=OFFSET([#Headers], -3, 0, 1, 1)

The formula will adjust to show the table name as in, 该公式将进行调整,以显示表格名称,如下所示:

=OFFSET(Table1[#Headers], -3, 0, 1, 1)

Copying the table will adjust the internal formula to the new table's name. 复制表会将内部公式调整为新表的名称。 eg 例如

=OFFSET(Table2[#Headers], -3, 0, 1, 1)

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

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