Change text string order

Pretender

New Member
Joined
Feb 11, 2009
Messages
30
I have a whole bunch of cells with text strings that look like this: 10-AXH-061

The text shown above should be changed into 10-061-AXH instead of 10-AXH-061.
Is there a formula to change the order of the text string?
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Thanks for the fast response, the formula solves the problem in most cases. There are some exceptions:
Sometimes the number is more complex like 07-RvdW-160 (4 digits in the middle) or RBO-10-MJR-139.

Any ideas?
 
Upvote 0
For the RVDW example (and your earlier one) try

=LEFT(A1,3)&RIGHT(A1,3)&MID(A1,3,FIND("-",SUBSTITUTE(A1,"-","~",1))-FIND("-",A1))

With the possibility of multiple - it gets much more complicated. One way would be to use Data > Text to columns, delimited with - as the delimiter to split the codes across columns, then use a concatenate formula to reassemble the codes.
 
Upvote 0
Thanks for the tip! I had also considered text to columns, but Excel insists to turn "061" into "61" etc.
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

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