G
Guest
What formula would I use to look up the address of the maximum value in a
column and return the cell address not the value?
column and return the cell address not the value?
Carolan said:What formula would I use to look up the address of the maximum value in a
column and return the cell address not the value?
....Duke Carey said:Assume you have a column header in row one, & that cell is named 'hdr'
Assume your column of values is named tbl, and starts in row 2
=ADDRESS(ROW(OFFSET(hdr,MATCH(MAX(tbl),tbl),0)),COLUMN(hdr))
Harlan Grove said:....
MATCH(MAX(tbl),tbl) would only work when tbl is sorted in ascending order,
in which case ROWS(tbl) would be much simpler. Perhaps you meant
MATCH(MAX(tbl),tbl,0)?
More compact to use
=CELL("Address",INDEX(tbl,MATCH(MAX(tbl),tbl,0)))
Roger Govier said:Hi
Create a named range to cover all of your data, called myData
Then use
=INDEX(myData,MATCH(MAX(tbl),tbl,0),COLUMN(B1))
to pick up the value for January, assuming that column A holds the Year
number and column B holds January data
As you copy across, column(B1) will change to C1, D1 etc to give you values
for Feb, Mar etc.
Roger Govier said:Hi Tim
COLUMN() returns the column number, 1 for column A, 2 for B etc.
Specifying COLUMN(B1) is telling the formula to use 2 as the column Offset
in the Index of myData.
As you drag across, it steps the number up accordingly.
It is exactly the same as typing
=INDEX(myData,MATCH(MAX(tbl),tbl,0),2)
but it saves having to alter the column offset manually as you copy across
the page.