Vlookup challenge
Try this UDF (User Defined function). From workbook launch VBE using Alt+F11.
From menu Insert a Module and paste the below function.
1. Select the range in Col A of Table 1 including the header. You need to
have headers for this column
2. From menu DataFilterAdvanced FilterCopy to another location
3. In copy to I have selected D1 and check 'Unique records only'
4. Click OK will give you the unique list of year and title in Col D
6. In E2 apply the below formula
=vlookups(D1,$A$2:$B$100,2)
Function VLOOKUPS(strTemp As String, rngTemp As Range, intCol As Integer) As
String
Dim lngRow As Long
For lngRow = 1 To rngTemp.Rows.Count
If rngTemp(lngRow, 1).Text = strTemp Then _
VLOOKUPS = VLOOKUPS & rngTemp(lngRow, intCol)
Next
End Function
If this post helps click Yes
---------------
Jacob Skaria
"Steve Albert" wrote:
I have a spreasheet with two columns. The first column has a list of Incident
numbers and the scond column has notes about the Incident (Table 1). If some
of the Incident numbers are the same, how can i write a lookup to concatenate
all of the note fields for one incident number (Table 2)?
Table 1
Incident # Note
------------ -----
101 This was completed yesterday.
102 Still in process.
103 Will complete tomorrow.
102 Called person on 8-5-09.
103 Delay in completing.
Table 2
Incident # Note
----------- -----
101 This was completed yesterday.
102 Still in process. Called person on 8-5-09.
103 Will complete tomorrow. Delay in completing.
|