简体   繁体   中英

ADDRESS() inside an OFFSET() function on excel

I have the following function which returns the maximum column value location:

=ADDRESS(MATCH(MAX(B1:B18),B1:B18,0),1)

when I add OFFSET to the function to get the corresponding value in another column it does not work!

=OFFSET(ADDRESS(MATCH(MAX(B1:B18),B1:B18,0),1),1,0)

Any other way to do this?

I have two colomns:

Time (hours)    Cp (ug/L)
0               0
0.1             26.282
0.25            46.532
0.5             57.046
0.75            57.411
1               55.028

I want to find the maximum value in Cp colomn and return the time at that maximum value. In this example, maximum value is 57.411 and it was at time 0.75.. the field should return 0.75

Try the non-volatile solution.

=INDEX(A1:A18, MATCH(MAX(B1:B18), B1:B18, 0))
'or,
=INDEX(A:A, MATCH(MAX(B:B),B:B, 0))

fwiw, I have not found many situations where the volatile¹ OFFSET function cannot be replaced with the non-volatile INDEX function .

index_offset


¹ Volatile functions recalculate whenever anything in the entire workbook changes, not just when something that affects their outcome changes. Examples of volatile functions are INDIRECT , OFFSET , TODAY , NOW , RAND and RANDBETWEEN . Some sub-functions of the CELL and INFO worksheet functions will make them volatile as well.

它不起作用,因为ADDRESS()返回一个字符串而OFFSET()需要一个引用,但有一个更简单的方法:

=OFFSET(A1, MATCH(MAX(B1:B18), B1:B18, 0) - 1, 0)

You can wrap your ADDRESS() in INDIRECT() .

This will convert it from text to reference format.

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