Concatenate codes for ref number semicolon delimited in row.

wikus

Active Member
Joined
May 2, 2010
Messages
318
Office Version
  1. 365
I have a reference number with multiple codes. I want to concatenate the codes semi colon delimited in column C next to first reference row.
Any help will be appreciated.

1708950950124.png
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
textjoin() and filter()
assuming they are always in order then
=IF(A1=A2,"",TEXTJOIN(";",,FILTER($B$2:$B$9,$A$2:$A$9=A2)))
otherwise a countIF maybe required

Book14
ABC
1
2a1A1-1A1-1;A1-2;A1-3
3a1A1-2 
4a1A1-3 
5b5B5-1B5-1;B5-2
6b5B5-2 
7c3C3-1C3-1;C3-2;C3-3
8c3C3-2 
9c3C3-3 
Sheet1
Cell Formulas
RangeFormula
C2:C9C2=IF(A1=A2,"",TEXTJOIN(";",,FILTER($B$2:$B$9,$A$2:$A$9=A2)))


=IF(COUNTIF($A$2:A2,A2)>1,"",TEXTJOIN(";",,FILTER($B$2:$B$9,$A$2:$A$9=A2)))

Book14
ABC
1
2a1A1-1A1-1;A1-2;A1-3
3a1A1-2 
4a1A1-3 
5b5B5-1B5-1;B5-2
6b5B5-2 
7c3C3-1C3-1;C3-2;C3-3
8c3C3-2 
9c3C3-3 
Sheet1
Cell Formulas
RangeFormula
C2:C9C2=IF(COUNTIF($A$2:A2,A2)>1,"",TEXTJOIN(";",,FILTER($B$2:$B$9,$A$2:$A$9=A2)))
 
Upvote 0
How about
Excel Formula:
=IF(COUNTIFS(A$2:A2,A2)=1,TEXTJOIN(";",,FILTER($B$2:$B$100,$A$2:$A$100=A2)),"")
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,018
Messages
6,128,307
Members
449,439
Latest member
laurenwydo

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