admin管理员组文章数量:1379419
The following formula is static.
=MAX(A5:C10)
I need dynamic formula because data range is variable.
I want to use row number and column number of cell reference.
I have tried the following formula but the following formula doesnt work.
=MAX(ADDRESS(5,1):ADDRESS(10,3))
Any solution?
The following formula is static.
=MAX(A5:C10)
I need dynamic formula because data range is variable.
I want to use row number and column number of cell reference.
I have tried the following formula but the following formula doesnt work.
=MAX(ADDRESS(5,1):ADDRESS(10,3))
Any solution?
Share Improve this question edited Mar 20 at 9:34 Markowitz asked Mar 20 at 7:55 MarkowitzMarkowitz 356 bronze badges 4 |1 Answer
Reset to default 2Formula like =ADDRESS(5,1)
will return a cell address as text, not as an actual cell reference.
To turn it into an actual cell reference you need to wrap the formula with indirect - =INDIRECT(ADDRESS(5,1))
.
As you no doubt know you reference a range of cells using :
between the start and end cell reference, but =ADDRESS(5,1):ADDRESS(10,3)
won't work as the ADDRESS
function returns text, while the :
part expects a cell reference.
So we can either use INDIRECT
on both ADDRESS
functions: =INDIRECT(ADDRESS(5,1)):INDIRECT(ADDRESS(10,3))
or create a text string representing the full range and use INDIRECT
on that =INDIRECT(ADDRESS(5,1) & ":" & ADDRESS(10,3))
- here :
is being treated as text so needs to be joined with the rest using & ":" &
Then just wrap the whole lot with MAX
to find the maximum value: =MAX(INDIRECT(ADDRESS(5,1) & ":" & ADDRESS(10,3)))
The address row and column numbers can be swapped out for cell references if you're calculating those elsewhere - something like =MAX(INDIRECT(ADDRESS(F1,G1) & ":" & ADDRESS(F2,G2)))
本文标签: excelMax function by using row number and column number of cell referenceStack Overflow
版权声明:本文标题:excel - Max function by using row number and column number of cell reference - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744424418a2605614.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
=MAX(A5:INDEX($C:$C,COUNTA($A:$A)+4))
maybe, or=MAX(Table1)
might be better... all depends on the data. – Darren Bartrup-Cook Commented Mar 20 at 8:11=MAX(INDIRECT(ADDRESS(5,1) & ":" & ADDRESS(10,3)))
but I think you're making it more complicated than it needs to be. – Darren Bartrup-Cook Commented Mar 20 at 8:28TRIMRANGE()
is introduced to refer full columns. – Harun24hr Commented Mar 20 at 8:41