Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Formula to Find Max in a Row and Return Column Title

I have searched for this and not found exacly what I need.

I have a dataset of 550 rows * 23 columns of data. What I am looking
to do is create a formula that compares by row the values in each
column and returns the column header/title that has the highest
value.

For example, column A has names and columns C-Y has spend amounts. I
want to identify which category had the highest spend and return that
category name in column B.

I have found how to identify the call value for the MAX and how to
return the column title for each column, but not how to combine the
two.

=MAX(C554:Y554)
returns the highest value of row 554 (24.71%)

=CELL("address",INDEX(C554:Y554,MATCH(MAX(C554:Y55 4),C554:Y554,0)))
returns the cell value of the MAX value ($J$554)

=OFFSET(J554,-552,0)
returns the column title for column J ("ABC")

But when I try to combine the formulas I get an error:
=OFFSET(CELL("address",INDEX(C554:Y554,MATCH(MAX(C 554:Y554),C554:Y554,0))),-552,0)

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Formula to Find Max in a Row and Return Column Title

If you can repeat the headers at the bottom of your data set (even hide them
in row 65535), then you could you the HLOOKUP function to return your headers:

=HLOOKUP (MAX(...), datarange, offset,false)

"zwestbrook" wrote:

I have searched for this and not found exacly what I need.

I have a dataset of 550 rows * 23 columns of data. What I am looking
to do is create a formula that compares by row the values in each
column and returns the column header/title that has the highest
value.

For example, column A has names and columns C-Y has spend amounts. I
want to identify which category had the highest spend and return that
category name in column B.

I have found how to identify the call value for the MAX and how to
return the column title for each column, but not how to combine the
two.

=MAX(C554:Y554)
returns the highest value of row 554 (24.71%)

=CELL("address",INDEX(C554:Y554,MATCH(MAX(C554:Y55 4),C554:Y554,0)))
returns the cell value of the MAX value ($J$554)

=OFFSET(J554,-552,0)
returns the column title for column J ("ABC")

But when I try to combine the formulas I get an error:
=OFFSET(CELL("address",INDEX(C554:Y554,MATCH(MAX(C 554:Y554),C554:Y554,0))),-552,0)

Any suggestions?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Formula to Find Max in a Row and Return Column Title

Assuming your data starts on Row 2, put this formula in B2 and copy down...

=INDEX(C$1:Y$1,MATCH(MAX(C2:Y2),C2:Y2,0))

--
Rick (MVP - Excel)


"zwestbrook" wrote in message
...
I have searched for this and not found exacly what I need.

I have a dataset of 550 rows * 23 columns of data. What I am looking
to do is create a formula that compares by row the values in each
column and returns the column header/title that has the highest
value.

For example, column A has names and columns C-Y has spend amounts. I
want to identify which category had the highest spend and return that
category name in column B.

I have found how to identify the call value for the MAX and how to
return the column title for each column, but not how to combine the
two.

=MAX(C554:Y554)
returns the highest value of row 554 (24.71%)

=CELL("address",INDEX(C554:Y554,MATCH(MAX(C554:Y55 4),C554:Y554,0)))
returns the cell value of the MAX value ($J$554)

=OFFSET(J554,-552,0)
returns the column title for column J ("ABC")

But when I try to combine the formulas I get an error:
=OFFSET(CELL("address",INDEX(C554:Y554,MATCH(MAX(C 554:Y554),C554:Y554,0))),-552,0)

Any suggestions?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Formula to Find Max in a Row and Return Column Title

On Oct 8, 2:51*pm, "Rick Rothstein"
wrote:
Assuming your data starts on Row 2, put this formula in B2 and copy down....

=INDEX(C$1:Y$1,MATCH(MAX(C2:Y2),C2:Y2,0))

--
Rick (MVP - Excel)

"zwestbrook" wrote in message

...

I have searched for this and not found exacly what I need.


I have a dataset of 550 rows * 23 columns of data. What I am looking
to do is create a formula that compares by row the values in each
column and returns the column header/title that has the highest
value.


For example, column A has names and columns C-Y has spend amounts. I
want to identify which category had the highest spend and return that
category name in column B.


I have found how to identify the call value for the MAX and how to
return the column title for each column, but not how to combine the
two.


=MAX(C554:Y554)
returns the highest value of row 554 (24.71%)


=CELL("address",INDEX(C554:Y554,MATCH(MAX(C554:Y55 4),C554:Y554,0)))
returns the cell value of the MAX value ($J$554)


=OFFSET(J554,-552,0)
returns the column title for column J ("ABC")


But when I try to combine the formulas I get an error:
=OFFSET(CELL("address",INDEX(C554:Y554,MATCH(MAX(C 554:Y554),C554:Y554,0))),-552,0)


Any suggestions?


Rick....this works great! If you have a moment I would appreciate you
breaking your formula down explaining how it works. Thanks again!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Formula to Find Max in a Row and Return Column Title

As you already know, MAX(C2:Y2) finds the maximum value in the range C2:Y2.
Then MATCH(MAX(C2:Y2),C2:Y2,0) find the offset to that value within the
range used to determine the maximum. That offset is then used in the INDEX
function to find the value at that offset distance in the row with the
headers. I hope that is clear enough (the wording seems more awkward than
the thought process behind them).

--
Rick (MVP - Excel)


"zwestbrook" wrote in message
...
On Oct 8, 2:51 pm, "Rick Rothstein"
wrote:
Assuming your data starts on Row 2, put this formula in B2 and copy
down...

=INDEX(C$1:Y$1,MATCH(MAX(C2:Y2),C2:Y2,0))

--
Rick (MVP - Excel)

"zwestbrook" wrote in message

...

I have searched for this and not found exacly what I need.


I have a dataset of 550 rows * 23 columns of data. What I am looking
to do is create a formula that compares by row the values in each
column and returns the column header/title that has the highest
value.


For example, column A has names and columns C-Y has spend amounts. I
want to identify which category had the highest spend and return that
category name in column B.


I have found how to identify the call value for the MAX and how to
return the column title for each column, but not how to combine the
two.


=MAX(C554:Y554)
returns the highest value of row 554 (24.71%)


=CELL("address",INDEX(C554:Y554,MATCH(MAX(C554:Y55 4),C554:Y554,0)))
returns the cell value of the MAX value ($J$554)


=OFFSET(J554,-552,0)
returns the column title for column J ("ABC")


But when I try to combine the formulas I get an error:
=OFFSET(CELL("address",INDEX(C554:Y554,MATCH(MAX(C 554:Y554),C554:Y554,0))),-552,0)


Any suggestions?


Rick....this works great! If you have a moment I would appreciate you
breaking your formula down explaining how it works. Thanks again!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find max value in one column and return the value of corrosponding cell in different column [email protected] Excel Worksheet Functions 5 October 16th 07 12:33 PM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Find max value in a row and return column title Jshendel Excel Worksheet Functions 5 July 21st 06 05:23 PM
Named range=Column title,comumn title in cellB6 use B6in equation Graham Excel Discussion (Misc queries) 2 July 21st 06 10:03 AM
Return Title to matched column [email protected] New Users to Excel 1 February 21st 06 06:04 AM


All times are GMT +1. The time now is 03:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"