complicated merge duplicated items with comma based on multiple columns

abdo meghari

Well-known Member
Joined
Aug 3, 2021
Messages
635
Office Version
  1. 2019
hi expert
I hope finding what I look for despite of it's very complicated I have many duplicated items in COLS E,F,G in sheet1 . it should merge based on three columns together for each code in COL B and merge with comma in COL C,D based on duplicated items in COLS E,F,G . so each code in COL B end to last empty cell before start a new code . I put desired result in sheet2 with considering my data in sheet1 is increasable . current data are about 3200 rows
note: when you see stars this is actually short word JAPAN but when I use tool XL2BB it shows stars

original data in sheet1
merge.xlsm
ABCDEFGH
1DATECODEINVOICE NOORDER NO BRANDTYPEORIGINQTY
201/01/2021BRSINV1000OR-10001200R20G580JAP200
302/01/2021INV1000OR-10001200R20G580THI120
403/01/2021INV1000OR-10001200R20R187JAP100
504/01/2021BRSINV1001OR-10011200R20G580JAP20
605/01/2021INV1002OR-10021200R20G580THI10
706/01/2021INV1003OR-10031200R20R187JAP30
807/01/2021INV1004OR-10041200R20R187THI30
908/01/2021BSSINV1005OR-1005195R15CR623JAP10
1009/01/2021INV1005OR-1005195R15CR623THI5
1110/01/2021INV1005OR-1005195R15CR623INDO10
1211/01/2021BSSINV1006OR-1006195R15CR623INDO10
SHEET1



result in sheet2
merge.xlsm
ABCDEFGH
1S.NCODEINVORDDETYORQTY
21BRSINV1000,1001OR-1000,10011200R20G580JAP220
32INV1000,1002OR-1000,10021200R20G580THI130
43INV1000,1003OR-1000,10031200R20R187JAP130
54INV1004OR-10041200R20R187THI30
61BSSINV1005OR-1005195R15CR623JAP10
72INV1005OR-1005195R15CR623THI5
83INV1005,1006OR-1005,1006195R15CR623INDO20
SHEET2


thanks
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I think Power Query is the way to go (already a part of Excel that most users don't really know about). Group By is powerful. This video explains a single column but should be expandable to handle two columns.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

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