ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   find Max value in row--return value in same column, different row (https://www.excelbanter.com/excel-worksheet-functions/23946-find-max-value-row-return-value-same-column-different-row.html)

goofy11

find Max value in row--return value in same column, different row
 
I'm not sure how to accomplish this and thought someone may be able to give
me some ideas. Here's an example of how my data is laid out.

Row 1 Chevy Ford Dodge
Row 2 4 5 3
Row 3 5 3 4

I would like to enter a formula that would look for the maximum value in
each row and return the corresponding value in the same column, from row 1.
In the example the formula looking in row 2, would return "Ford". In row 3
the result would be "Chevy". I've been mulling over this but can't figure
out how to make this work. Any help would be appreciated.

Vasant Nanavati

=INDEX((A$1:C$1),MATCH(MAX(A2:C2),A2:C2,0))

etc.

--

Vasant

"goofy11" wrote in message
...
I'm not sure how to accomplish this and thought someone may be able to

give
me some ideas. Here's an example of how my data is laid out.

Row 1 Chevy Ford Dodge
Row 2 4 5 3
Row 3 5 3 4

I would like to enter a formula that would look for the maximum value in
each row and return the corresponding value in the same column, from row

1.
In the example the formula looking in row 2, would return "Ford". In row

3
the result would be "Chevy". I've been mulling over this but can't figure
out how to make this work. Any help would be appreciated.




Aladin Akyurek

Let A1:C4 house the following sample:

{"Chevy","Ford","Dodge";
2,4,5;
3,5,3;
7,7,4}

where A1 = Chevy, A2 = 2, etc.

Formulas...

D2, copied to F2 then down:

=IF(N(A2),RANK(A2,$A2:$C2)+COUNTIF($A2:A2,A2)-1,"")

G2:

=MAX(IF(INDEX(A2:C2,MATCH($H2,D2:F2,0))=A2:C2,D2:F 2))-$H2

which must be confirmed with control+shift+enter instead of just with
enter.

This formula computes the number of ties of the max value.

H2 to H4 must house a 1, which denotes Top 1 highest.

I2, copied across to K2 then down:

=IF(COLUMN()-COLUMN($I2)+1<=$G2+$H2,INDEX($A$1:$C$1,MATCH(COLUM N()-COLUMN($I2)+1,$D2:$F2,0)),"")


I2:K4 will now house the results that you need.

goofy11 wrote:
I'm not sure how to accomplish this and thought someone may be able to give
me some ideas. Here's an example of how my data is laid out.

Row 1 Chevy Ford Dodge
Row 2 4 5 3
Row 3 5 3 4

I would like to enter a formula that would look for the maximum value in
each row and return the corresponding value in the same column, from row 1.
In the example the formula looking in row 2, would return "Ford". In row 3
the result would be "Chevy". I've been mulling over this but can't figure
out how to make this work. Any help would be appreciated.



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

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