Show me in which column corresponds the max value

Kwnstantinos_M

New Member
Joined
Jun 12, 2018
Messages
24
Hello,

I have 4 columns of data, like this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]NE[/TD]
[TD]NW[/TD]
[TD]SE[/TD]
[TD]SW[/TD]
[TD]Prevailing[/TD]
[/TR]
[TR]
[TD]45[/TD]
[TD]30[/TD]
[TD]22[/TD]
[TD]31[/TD]
[TD]NE[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]59[/TD]
[TD]51[/TD]
[TD]42[/TD]
[TD]NW[/TD]
[/TR]
[TR]
[TD]71[/TD]
[TD]44[/TD]
[TD]21[/TD]
[TD]18[/TD]
[TD]NE[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]5[/TD]
[TD]22[/TD]
[TD]56[/TD]
[TD]SW[/TD]
[/TR]
</tbody>[/TABLE]

The first 4 columns contain numbers of wind data. In the fifth column I want to write a command, by which the name of the prevailing wind (namely the name of the column) will be returned as a result. For instance, in the 2nd row NE has the highest number, therefore NE is written in the fifth column etc. Do you have any ideas?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Let's say that your data is in the range A1:D5.
Then, place this formula in E2 and copy down to E5:
Code:
=INDEX($A$1:$D$1,MATCH(MAX(A2:D2),A2:D2,0))
 
Upvote 0
It returns the maximum value instead of the name of the column.. I want to return the name of the column corresponding to the maximum value. Do you know I mean? Instead of return the highest value, to show me NE or NW etc.
 
Upvote 0
It returns the maximum value instead of the name of the column.. I want to return the name of the column corresponding to the maximum value. Do you know I mean? Instead of return the highest value, to show me NE or NW etc.
I know exactly what you are saying, and if you follow my assumptions, it DOES, in fact, return the direction and not the number.
My guess if you edited my formula, and didn't do it properly.

Let me know the EXACT range your data appears in, and then let me know the exact formula you are using (and what cell you are placing it in).
 
Upvote 0
Yes you are right.. I made a mistake. Your command is perfect. Thank you very much, and I'm sorry.. my mistake! Thanks again!
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,596
Members
452,657
Latest member
giadungthienduyen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top