KarthickDijo
New Member
- Joined
- Sep 14, 2022
- Messages
- 28
- Office Version
- 2019
- Platform
- Windows
Sub test()
Dim a As Variant, lr, i, x, s, k, itm
a = Range("A3:A" & Cells(Rows.Count, 1).End(xlUp).Row).Resize(, 2)
With CreateObject("scripting.dictionary")
For i = 1 To UBound(a)
If a(i, 1) <> 0 Then
If Not .exists(a(i, 1)) Then
.Add a(i, 1), a(i, 2)
Else
.Item(a(i, 1)) = .Item(a(i, 1)) & " | " & a(i, 2)
End If
End If
Next
Cells(3, 4).Resize(.Count, 2) = Application.Transpose(Array(.keys, .items))
End With
End Sub
Why are you using B3:B11>=A2 as the filter criteria?
Hi there
Not sure if this will work for you?
Book1
A B C D E 1 Input 2 Brand Color Brand All Colours 3 Apple Blue Apple Blue|Yellow 4 Apple Yellow Samsung Red 5 Samsung Red Sony Red|Green|Blue 6 Sony Red Lenovo Orange|Black 7 Sony Green Dell White 8 Sony Blue 9 Lenovo Orange 10 Lenovo Black 11 Dell White Sheet1
Cell Formulas Range Formula D3:D7 D3 =FILTER(A3:A12,(B3:B12>=A1),"NA") E3:E7 E3 =TEXTJOIN("|",TRUE,IF(A3:A11=D3,B:B11,"")) Dynamic array formulas.
Am not getting the expected result, attached the result arrived. Is there more steps to be executed post this ??Turn the data into a table and load it into the data model using the Power Pivot tab. Then create a power pivot table and add a measure like:
Excel Formula:=CONCATENATEX(VALUES(Table1[Color]),[Color],"|")
where Table1 is the name of the table you created at the start.