Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: finding 2nd highest value 1

Status
Not open for further replies.

mickeyg

Technical User
Mar 30, 2001
120
US
In Excel I can use the max function to find the highest value, but how can I find the 2nd highest value in a column?

Thanks in advance,
Mickey
 
Try using the Large function. It has this syntax:
Code:
=LARGE(array,k)
You would select your column of numbers for "array", then the number of the position for "k". Say you have numbers in cells A1 thru A100 and want to find the second largest:
Code:
=LARGE(A1:A100,2)
Hope this helps.
 
Hi,
Use this as a spreadsheet function. Ite will return the second highest value:
Code:
Function MaxVisible(rng As Range)
    Dim Max, MaxVal
    MaxVal = Application.Max(rng)
    Max = 0
    For Each cell In rng
        With cell
            If .Value < MaxVal Then _
                If .Value > Max Then Max = .Value
        End With
    Next
    MaxVisible = Max
End Function
Skip,
metzgsk@voughtaircraft.com
 
The large function is by far the quickest, easiest way.
 
Thanks guys!
I did go with the LARGE function.

Mickey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top