Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Conrad Evans   on Jan 19 In MS Office Category.

  
Question Answered By: Jet Brown   on Jan 19

Here is a custom function  that gives the desired output. I only tested with the
data you provided (haven't tested it with negative numbers  in the range, etc.):

Public Function NextBiggest(ValRng As Range, ChkRng As Range) As Double
Dim c As Range, tmp As Double
tmp = Application.WorksheetFunction.Max(ChkRng)
For Each c In ChkRng
If c.Value > ValRng.Value Then
If c.Value < tmp Then
tmp = c.Value
End If
End If
Next c
NextBiggest = tmp
End Function

You call the function like this:

=NextBiggest(C5,C10:C53)

In this example, the chart  numbers are in cells C10:C53.

Share: 

 

This Question has 10 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on If nesting limits Or get search suggestion and latest updates.


Tagged: