ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Column Header Listing for highest value in a row (https://www.excelbanter.com/excel-discussion-misc-queries/110995-column-header-listing-highest-value-row.html)

PZach18

Column Header Listing for highest value in a row
 
Thanks for anyone's help in advance . . .


A spreadsheet contains data in columns A-D, for 100 rows.
In row 1, a title for each column exists.
How do I have each row's Column E contain the column title for the cell in
that row that has the highest value?

Thanks!

JLatham

Column Header Listing for highest value in a row
 
Put this formula in E2 and fill down:
=OFFSET($A$1,0,MATCH(MAX(A2:D2),A2:D2,0)-1)

The MAX() portion finds the highest value in the row,
The MATCH() that it is wrapped in then uses the MAX value to get a relative
column number (from 1 to 4 in this case), but we need to subtract one from it
so that we can use it as the column offset value in the OFFSET() function.

Be sure to use the $ symbols where I did, and leave them out elsewhere.


"PZach18" wrote:

Thanks for anyone's help in advance . . .


A spreadsheet contains data in columns A-D, for 100 rows.
In row 1, a title for each column exists.
How do I have each row's Column E contain the column title for the cell in
that row that has the highest value?

Thanks!


Roger Govier

Column Header Listing for highest value in a row
 
Hi

Alternatively you could use the non-volatile
=INDEX($A$1:$D$1,MATCH(MAX(A2:D2),A2:D2,0))

--
Regards

Roger Govier


"JLatham" <HelpFrom @ Jlathamsite.com.(removethis) wrote in message
...
Put this formula in E2 and fill down:
=OFFSET($A$1,0,MATCH(MAX(A2:D2),A2:D2,0)-1)

The MAX() portion finds the highest value in the row,
The MATCH() that it is wrapped in then uses the MAX value to get a
relative
column number (from 1 to 4 in this case), but we need to subtract one
from it
so that we can use it as the column offset value in the OFFSET()
function.

Be sure to use the $ symbols where I did, and leave them out
elsewhere.


"PZach18" wrote:

Thanks for anyone's help in advance . . .


A spreadsheet contains data in columns A-D, for 100 rows.
In row 1, a title for each column exists.
How do I have each row's Column E contain the column title for the
cell in
that row that has the highest value?

Thanks!




PZach18

Column Header Listing for highest value in a row
 
JLatham, thanks for your help, I'm really close. . .

Now suppose that the data is located in columns AJ to AO. The way the
formula is currently set up, it is giving me the header for columns 1-4, just
like my example. How do I change that?

Thanks so much for your help!

"JLatham" wrote:

Put this formula in E2 and fill down:
=OFFSET($A$1,0,MATCH(MAX(A2:D2),A2:D2,0)-1)

The MAX() portion finds the highest value in the row,
The MATCH() that it is wrapped in then uses the MAX value to get a relative
column number (from 1 to 4 in this case), but we need to subtract one from it
so that we can use it as the column offset value in the OFFSET() function.

Be sure to use the $ symbols where I did, and leave them out elsewhere.


"PZach18" wrote:

Thanks for anyone's help in advance . . .


A spreadsheet contains data in columns A-D, for 100 rows.
In row 1, a title for each column exists.
How do I have each row's Column E contain the column title for the cell in
that row that has the highest value?

Thanks!


PZach18

Column Header Listing for highest value in a row
 
I figured it out. THANKS SO MUCH!

"JLatham" wrote:

Put this formula in E2 and fill down:
=OFFSET($A$1,0,MATCH(MAX(A2:D2),A2:D2,0)-1)

The MAX() portion finds the highest value in the row,
The MATCH() that it is wrapped in then uses the MAX value to get a relative
column number (from 1 to 4 in this case), but we need to subtract one from it
so that we can use it as the column offset value in the OFFSET() function.

Be sure to use the $ symbols where I did, and leave them out elsewhere.


"PZach18" wrote:

Thanks for anyone's help in advance . . .


A spreadsheet contains data in columns A-D, for 100 rows.
In row 1, a title for each column exists.
How do I have each row's Column E contain the column title for the cell in
that row that has the highest value?

Thanks!



All times are GMT +1. The time now is 05:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com