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:
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.