Home |
Search |
Today's Posts |
#5
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need a ISWorkday Function -- Any Ideas | Excel Worksheet Functions | |||
Hyperlinks using R[1]C[1] and offset function in its cell referenc | Excel Worksheet Functions | |||
Conversion | Excel Worksheet Functions | |||
Trim function doesn't clean out ASCII Code 160 (Space) | Excel Worksheet Functions | |||
Formula to list unique values | Excel Worksheet Functions |