If your Max value appears more than once, you might like
to use:
100 PHILLIES
200 BREWERS
300 RANGERS
200 BREWERS
300 OTHERS
=MAX(A1:A5) =vlookupall(A6,A1:B5,2)
where vlookupall() is defined as:
Option Explicit
Public Function vlookupall$(strSearch As String, rngRange
As Range, lngLookupCol As Long)
'Vlookupall searches in first column of rngRange for
strSearch and returns corresponding
'values of column lngLookupCol if strSearch was found. All
corr. values are collected and
'returned in one string (result of function).
Dim i As Long
If lngLookupCol rngRange.Columns.Count Then
vlookupall = CVErr(xlErrValue)
Exit Function
End If
vlookupall = ""
For i = 1 To rngRange.Rows.Count
If rngRange(i, 1).Text = strSearch Then
vlookupall = vlookupall & rngRange(i,
lngLookupCol).Text & "; "
End If
Next i
If Right(vlookupall, 2) = "; " Then
vlookupall = Left(vlookupall, Len(vlookupall) - 2)
End If
End Function
HTH,
Bernd
|