Grouping Data

KarthickDijo

New Member
Joined
Sep 14, 2022
Messages
28
Office Version
  1. 2019
Platform
  1. Windows
Hi All,

I need to group few data (in a column) based on the another column. Kindly help me out how it can be done apart from VBA. Attached the sample input and output.

Thanks in advance
 

Attachments

  • Excel Doubt.jpg
    Excel Doubt.jpg
    35 KB · Views: 10
Why are you using B3:B11>=A2 as the filter criteria?
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi
Try this option
Maybe
VBA Code:
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
 
Upvote 0
Why are you using B3:B11>=A2 as the filter criteria?

It was a formula I found while searching which seemed to do the job... but it gave me the two "Sony" results so played around with it until got the correct result. Just not sure why.. trying to teach myself by combing different formulas... Realize that it actually means B3:B11 is bigger than or equal to A2... which might be more suited to numbers...
 
Upvote 0
Hi there

Not sure if this will work for you?

Book1
ABCDE
1Input
2BrandColorBrandAll Colours
3AppleBlueAppleBlue|Yellow
4AppleYellowSamsungRed
5SamsungRedSonyRed|Green|Blue
6SonyRedLenovoOrange|Black
7SonyGreenDellWhite
8SonyBlue
9LenovoOrange
10LenovoBlack
11DellWhite
Sheet1
Cell Formulas
RangeFormula
D3:D7D3=FILTER(A3:A12,(B3:B12>=A1),"NA")
E3:E7E3=TEXTJOIN("|",TRUE,IF(A3:A11=D3,B:B11,""))
Dynamic array formulas.

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.
Am not getting the expected result, attached the result arrived. Is there more steps to be executed post this ??
 

Attachments

  • powerpivot_doubt.jpg
    powerpivot_doubt.jpg
    69.8 KB · Views: 3
Upvote 0
That's a calculated column, not a measure.
 
Upvote 0

Forum statistics

Threads
1,215,952
Messages
6,127,913
Members
449,411
Latest member
AppellatePerson

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