Macro to find copy "header" and paste

R

RunsWithKnives

Hi Folks,
This may sound easy but it has stumped me.
I have a list of max values at the end of a row of 48 columns. I want to
find that max value within the row and then copy and paste the header (first
row) for the column the max value appears within. I cannot use a LOOKUP
function as the data is not sorted and has too many fields to use an if
statement.

Cheers,
RunsWithKnives
 
B

Biff

Hi!

Row 1 are column headers, A1:AV1

A2:AV2 = values

AW2 = =MAX(A2:AV2)

Find the corresponding header:

=INDEX(A$1:AV$1,MATCH(AW2,A2:AV2,0))

If there are duplicate max values the hearder for the first match (left to
right) will be returned.

Biff
 
R

RunsWithKnives

Hey Cheers Biff,
that does the trick and I don't have to punt about with macros.

Thanks a bunch,

RunsWithKnives
 
B

Biff

You're welcome. Thanks for the feedback!

Biff

RunsWithKnives said:
Hey Cheers Biff,
that does the trick and I don't have to punt about with macros.

Thanks a bunch,

RunsWithKnives
 
Top