Concatenate unique text values in Excel 2016 (based on criteria in range)

art_TD

New Member
Joined
Sep 19, 2024
Messages
6
Office Version
  1. 2016
Hi! Could you please help with such issue?
I am trying to concatenate unique (exact) text values within a range (Name) based on a criteria in another range (Code). No VBA please, just formula(s).

CodeNameConcat
12345​
RollerRollerRoller; idler; sprocket;
12345​
Rolleridler; sprocket;
12345​
Rolleridler; sprocket;
12345​
Rolleridler; sprocket;
12345​
Rolleridler; sprocket;
12345​
Rolleridler; sprocket;
12345​
Rolleridler; sprocket;
12345​
IdlerIdlerIdler; sprocket;
12345​
Idlersprocket;
12345​
Idlersprocket;
12345​
Idlersprocket;
12345​
Idlersprocket;
12345​
Idlersprocket;
12345​
Idlersprocket;
12345​
Idlersprocket;
12345​
Idlersprocket;
12345​
Idlersprocket;
12345​
SprocketSprocketSprocket;
12345​
Sprocket
12345​
Sprocket
12345​
Sprocket
12345​
Sprocket
12345​
Sprocket
12345​
Sprocket
12345​
Sprocket
12345​
Sprocket
12345​
Sprocket
54321
RollerRollerRoller; ???; ???
54321
Idler
54321
Sprocket
 
I found out there could be some mistakes (on another longer list of codes and names) and got the formulas as follows.

Cell Formulas
RangeFormula
C2:C31C2=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,B2)=1,B2,"")
D2:D31D2=IF(A3="",C2&";",IF(NOT(A2=A3),"",IF(C2="",D3,C2&"; "&D3)))
E2:E31E2=IF(A3="",C2,IF(NOT(A2=A3),"",IF(C2="",E3,C2&IF(E3="","","; ")&E3)))
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,221,544
Messages
6,160,428
Members
451,645
Latest member
androidmj

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