For example, if I had:
Pen $1.00
Book $8.00
Tape $2.00
Pen $1.20
And I am looking for all matches of Pen, have the cell display:
$1.00, $1.20
Let me know if you need any more info, thanks!
For example, if I had:
Pen $1.00
Book $8.00
Tape $2.00
Pen $1.20
And I am looking for all matches of Pen, have the cell display:
$1.00, $1.20
Let me know if you need any more info, thanks!
you can do it in VBA but I don't know how to do it with formulae unless the number of lines of data and types of data are quite limited.
click on the * Add Reputation if this was useful or entertaining.
Thanks Tony, I was hoping to avoid VBA
Try this.
paste the code below into a VBA module. And then use this formula =myFunction( "pen" , H5:I8 ) The H5:I8 will need to be changed to the two column range you have your data in.
![]()
Function myFunction(ByVal KeyValue As String, ByRef Data2Columns As Range) As String Dim str As String Dim r As Range Dim rng As Range Set r = Data2Columns.Resize(, 1) For Each rng In r If rng.Value = KeyValue Then str = str & ", " & rng.Offset(, 1).Value End If Next If str = "" Then myFunction = "" Else myFunction = Mid(str, 3, 1000) End If End Function
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks