简体   繁体   中英

Excel Formula - Reference Moving/Dynamic Cell

I have a table with values in one of the columns (column K in this instance). The amount of the rows in the column can vary (the amount of rows are determined by the user through the use of a macro assigned button). Once the user has completed the table, a macro assigned button sums the values in the same column below the final row.

I would like to reference the cell with this sum (which is dynamic; could be k10 or could be k25) on another sheet. I am unable to figure out how to do this. I've been thinking it might involve the indirect or offset functions, but I'm not exactly sure.

Any help will be much appreciated.

要引用表格1中K列中最后一个数值的单元格,

=index(sheet1!k:k, match(1e99, sheet1!k:k))

Here is a solution involving Indirect. the COUNT function dynamically counts the size of the table. Adding 2 (1 for the headers and 1 for the total row) gives the row where the sum is calculated. INDIRECT and ADDRESS do the rest.

=INDIRECT(ADDRESS(COUNT(Table1[MyColumn])+2,1))

见代码

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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