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

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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,B3:B11,""))
Dynamic array formulas.
 
Upvote 0
Solution
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Grouping Data
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Another option for xl2019
Excel Doubt.xlsx
ABCDE
1BrandColorBrandAll Colors
2AppleBlueAppleBlue|Yellow
3AppleYellowSamsungRed
4SamsungRedSonyRed|Green|Blue
5SonyRedLenovoOrange|Black
6SonyGreenDellWhite
7SonyBlue  
8LenovoOrange  
9LenovoBlack
10DellWhite
11
Sheet1
Cell Formulas
RangeFormula
D2:D8D2=IFERROR(INDEX($A$2:$A$10,AGGREGATE(15,6,(ROW($A$2:$A$10)-ROW($A$2)+1)/(ISNA(MATCH($A$2:$A$10,D$1:D1,0))),1)),"")
E2:E8E2=IF(D2="","",TEXTJOIN("|",,IF(A2:A10=D2,B2:B10,"")))
 
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,B3:B11,""))
Dynamic array formulas.
Thanks a lot for the help !! :)
 
Upvote 0
Another option for xl2019
Excel Doubt.xlsx
ABCDE
1BrandColorBrandAll Colors
2AppleBlueAppleBlue|Yellow
3AppleYellowSamsungRed
4SamsungRedSonyRed|Green|Blue
5SonyRedLenovoOrange|Black
6SonyGreenDellWhite
7SonyBlue  
8LenovoOrange  
9LenovoBlack
10DellWhite
11
Sheet1
Cell Formulas
RangeFormula
D2:D8D2=IFERROR(INDEX($A$2:$A$10,AGGREGATE(15,6,(ROW($A$2:$A$10)-ROW($A$2)+1)/(ISNA(MATCH($A$2:$A$10,D$1:D1,0))),1)),"")
E2:E8E2=IF(D2="","",TEXTJOIN("|",,IF(A2:A10=D2,B2:B10,"")))
Thanks for the help !! Just one clarification, why can't we use "UNIQUE" function in the D2 cell.
 
Upvote 0
2019 doesn't have UNIQUE as far as I am aware.

You could also use Power Pivot to produce the result table.
 
Upvote 0
2019 doesn't have UNIQUE as far as I am aware.

You could also use Power Pivot to produce the result table.
Thanks for the info. Am not aware of power pivot, however will try to learn that asap. If possible kindly explain me how it can be done. :)
 
Upvote 0
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.
 
Upvote 0
Another option for xl2019
Excel Doubt.xlsx
ABCDE
1BrandColorBrandAll Colors
2AppleBlueAppleBlue|Yellow
3AppleYellowSamsungRed
4SamsungRedSonyRed|Green|Blue
5SonyRedLenovoOrange|Black
6SonyGreenDellWhite
7SonyBlue  
8LenovoOrange  
9LenovoBlack
10DellWhite
11
Sheet1
Cell Formulas
RangeFormula
D2:D8D2=IFERROR(INDEX($A$2:$A$10,AGGREGATE(15,6,(ROW($A$2:$A$10)-ROW($A$2)+1)/(ISNA(MATCH($A$2:$A$10,D$1:D1,0))),1)),"")
E2:E8E2=IF(D2="","",TEXTJOIN("|",,IF(A2:A10=D2,B2:B10,"")))

Hi Fluff... and apologies to OP for sort of hijacking this thread but I have a quick question... when working out the formula earlier... why does the below give me two options for "Sony" and not a unique list of values...

Book3.xlsx
ABCDE
1Input
2BrandColorBrandAll Colours
3AppleBlueAppleBlue | Yellow
4AppleYellowSamsungRed
5SamsungRedSonyRed|Green|Blue
6SonyRedSonyRed|Green|Blue
7SonyGreenLenovoOrange|Black
8SonyBlueDell
9LenovoOrange
10LenovoBlack
11DellWhite
Sheet1
Cell Formulas
RangeFormula
D3:D8D3=FILTER(A3:A11,(B3:B11>=A2),"NA")
E3E3=TEXTJOIN(" | ",TRUE,IF(A3:A11=D3,B3:B11,""))
E4:E7E4=TEXTJOIN("|",TRUE,IF(A4:A12=D4,B4:B12,""))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,155
Messages
6,123,335
Members
449,098
Latest member
thnirmitha

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