Concatenate of different rows data in a single cell

Jyotirmaya

Board Regular
Joined
Dec 2, 2015
Messages
205
Office Version
  1. 2019
Platform
  1. Windows
I have data in Sheet1 in Column A & B.
In Column A I have Data, based on the Column A Data there are data in Column B, I want that in Column C those data of Column B should place in a cell by sepearated by a Comma.

Book2.xlsx
ABC
11aa,b,c
2b
3c
45aa,b,c
5b
6c
74aa,b
8b
95aa,b,c,d,e,f
10b
11c
12d
13e
14f
156aa,b,c,d
16b
17c
18d
195aa,b,c,d,e,f,g
20b
21c
22d
23e
24f
25g
268aa
279aa
Sheet2


Please help me with the code.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

You might also clarify whether you are looking for a (formula/vba/power query/don't care) approach.
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

You might also clarify whether you are looking for a (formula/vba/power query/don't care) approach.
Yes sir updated account details, I am using Ms Excel 2019 in Windows, I am looking for a formula/VBA.
Thanks
 
Upvote 0
updated account details,
Thanks for that. (y)

I am looking for a formula/VBA.
Thanks
Try this in C1, copied down.
Assumes data does not go down to row 100. If it does, increase the 100 values in the formula.

Excel Formula:
=IF(A1="","",TEXTJOIN(",",1,B1:INDEX(B1:B$100,IFERROR(MATCH(TRUE,A2:A$100<>"",0),ROWS(A2:A$100)))))
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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