LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Bernd Plumhoff
 
Posts: n/a
Default

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a ISWorkday Function -- Any Ideas Mark Excel Worksheet Functions 5 March 29th 05 01:58 AM
Hyperlinks using R[1]C[1] and offset function in its cell referenc Elijah-Dadda Excel Worksheet Functions 0 March 5th 05 03:31 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
Trim function doesn't clean out ASCII Code 160 (Space) Ronald Dodge Excel Worksheet Functions 6 January 27th 05 03:48 AM
Formula to list unique values JaneC Excel Worksheet Functions 4 December 10th 04 12:25 AM


All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"