how do u reproduce a column heading elsewhere?

beastwood

New Member
Joined
May 1, 2002
Messages
16
problem....

say u have 3 columns named dave john neal

with user inputted numeric entries below each name..is there a way to display either dave john or neal in a seperate cell depending on who has the highest numeric value inputted in the cells below each name?
This message was edited by beastwood on 2002-05-03 13:53
 
Are you only checking one row at a time? If not, here is an amendment to my previous offering, which will list all the names having the MAX value.

Code:
Function MAXVALUE(Rng As Range)
Dim maxval As Double, usedcell As Range
Dim answer As String, x As Long

x = Rng.Row
maxval = WorksheetFunction.Max(Rng)
For Each usedcell In Rng
    If IsNumeric(usedcell) Then
        If usedcell = maxval Then
            On Error Resume Next
            If WorksheetFunction.Search(Cells(x, usedcell.Column), answer, 1) = 0 Then
                answer = answer & Cells(x, usedcell.Column) & ", "
            End If
            On Error GoTo 0
        End If
    End If
Next usedcell

MAXVALUE = Left(answer, Len(answer) - 2)

End Function
Note that this will only return one instance of each name. If Dave, for example, twice had the max, Dave would show only once in the result.
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
This formula will show any and ALL headings that have the max value.

With my formula I used a1,b1,c1 as headings and a2,b2,c2 as values.

I'm sure there is a prettier way to do this with array formulas but this works.

=IF(A2=(MAX(A2:C2)),A1,"") & " " & IF(B2=(MAX(A2:C2)),B1,"") & " " & IF(C2=(MAX(A2:C2)),C1,"")
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,855
Members
449,096
Latest member
Erald

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