Concatenate and Trim question

bflan0524

Board Regular
Joined
Oct 7, 2016
Messages
192
Office Version
  1. 2010
hello if column A row 1 says RM1-CT and Column B says Joe Smith how can i get column C Row 1 to say RM1-CT-Smith
 
there could be multiple underscores in the name column, for example Joe_Smith or Joe_Van_Smith etc
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Ok,

This will cover both:


Book1
ABD
1RM1-CTJoe SmithRM1-CT-Smith
2RM1-CTJoe_SmithRM1-CT-Smith
3RM1-CTJoe_ SmithRM1-CT-Smith
4RM1-CTJoe _SmithRM1-CT-Smith
5RM1-CTJoe _ SmithRM1-CT-Smith
6RM1-CTJoe_ _SmithRM1-CT-Smith
7RM1-CTJoe_Van_SmithRM1-CT-Smith
8RM1-CTJoe Van SmithRM1-CT-Smith
Sheet16
Cell Formulas
RangeFormula
D1=A1&"-"&TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(B1&" "," ","_"),"_",REPT(" ",50)),75))
 
Upvote 0
this worked perfect..ty
could you please break it down for me? thank you for your time on this
 
Upvote 0

Forum statistics

Threads
1,216,788
Messages
6,132,701
Members
449,753
Latest member
swastikExcel

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