Concatenate matching Row Data in single cell with exclusions

rpouvreau

New Member
Joined
Apr 15, 2016
Messages
2
I have been trying to determine how to search matching values in a column and return another column's value on the same row into a concatenated string, excluding the data in the second column from the string in the third

Using =Lookup_concat(A12,'other-finishes'!$C:$C,'other-finishes'!$A:$A) I am able to pull the values I need from the sheet, however, I do not want the item in the second column to also be listed in the string in the third.

As an example:

Base Sku id id string
244-117-01baby-appleseed-millbury-3-in-1-convertible-crib-espressobaby-appleseed-millbury-3-in-1-convertible-crib-slate baby-appleseed-millbury-3-in-1-convertible-crib-coco baby-appleseed-millbury-3-in-1-convertible-crib-espresso baby-appleseed-millbury-3-in-1-convertible-crib-moon-gray baby-appleseed-millbury-3-in-1-convertible-crib-pure-white
244-117-01baby-appleseed-millbury-3-in-1-convertible-crib-moon-graybaby-appleseed-millbury-3-in-1-convertible-crib-slate baby-appleseed-millbury-3-in-1-convertible-crib-coco baby-appleseed-millbury-3-in-1-convertible-crib-espresso baby-appleseed-millbury-3-in-1-convertible-crib-moon-gray baby-appleseed-millbury-3-in-1-convertible-crib-pure-white
244-117-01baby-appleseed-millbury-3-in-1-convertible-crib-pure-whitebaby-appleseed-millbury-3-in-1-convertible-crib-slate baby-appleseed-millbury-3-in-1-convertible-crib-coco baby-appleseed-millbury-3-in-1-convertible-crib-espresso baby-appleseed-millbury-3-in-1-convertible-crib-moon-gray baby-appleseed-millbury-3-in-1-convertible-crib-pure-white
244-117-01_244-119-09baby-appleseed-nursery-set-millbury-crib-double-dresser-slatebaby-appleseed-nursery-set-millbury-crib-double-dresser-slate baby-appleseed-nursery-set-millbury-crib-double-dresser-espresso baby-appleseed-nursery-set-millbury-crib-double-dresser-pure-white baby-appleseed-nursery-set-millbury-crib-double-dresser-moon-gray baby-appleseed-millbury-nursery-set-convertible-crib-double-dresser-coco
244-117-01_244-119-09baby-appleseed-nursery-set-millbury-crib-double-dresser-espressobaby-appleseed-nursery-set-millbury-crib-double-dresser-slate baby-appleseed-nursery-set-millbury-crib-double-dresser-espresso baby-appleseed-nursery-set-millbury-crib-double-dresser-pure-white baby-appleseed-nursery-set-millbury-crib-double-dresser-moon-gray baby-appleseed-millbury-nursery-set-convertible-crib-double-dresser-coco
244-117-01_244-119-09baby-appleseed-nursery-set-millbury-crib-double-dresser-pure-whitebaby-appleseed-nursery-set-millbury-crib-double-dresser-slate baby-appleseed-nursery-set-millbury-crib-double-dresser-espresso baby-appleseed-nursery-set-millbury-crib-double-dresser-pure-white baby-appleseed-nursery-set-millbury-crib-double-dresser-moon-gray baby-appleseed-millbury-nursery-set-convertible-crib-double-dresser-coco

<tbody>
</tbody>

I know I need to insert an IF function that determines if the value in id is in the string, to exclude that id, I just can't get my head around how to do so.

Thanks,

Renee
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Your Lookup_concat function is a UDF; without knowing how it's written, your question is going to be difficult to answer.
 
Upvote 0
Your Lookup_concat function is a UDF; without knowing how it's written, your question is going to be difficult to answer.

I was able to find a UDF on another site,

Function Lookup_concat(Search_string As String, _
Search_in_col As Range, Return_val_col As Range)


Dim i As Long
Dim temp() As Variant
Dim result As String
ReDim temp(0)


For i = 1 To Search_in_col.Count
If Search_in_col.Cells(i, 1) = Search_string Then
temp(UBound(temp)) = Return_val_col.Cells(i, 1).Value
ReDim Preserve temp(UBound(temp) + 1)
End If
Next


If temp(0) <> "" Then
ReDim Preserve temp(UBound(temp) - 1)
Unique temp
For i = LBound(temp) To UBound(temp)
result = result & " " & temp(i)
Next i
Lookup_concat = Trim(result)
Else
Lookup_concat = ""
End If


End Function

Renee
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,823
Members
449,470
Latest member
Subhash Chand

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top