Complicated text rearrange

phras81

New Member
Joined
Nov 2, 2018
Messages
11
Hi I am hoping someone can help.

Looking for a formula to use on a large excel sheet to rearrange the characters in a specific order. The following is an example.

"1f6f33b9-35bc-6d4b-8377-ca5fc024eae1" to change to "b9336f1f-bc35-4b6d-8377-ca5fc024eae1"

Basically the first set of 8 characters and the second 2 sets of 4 characters need to be in reverse order in batches of 2.

Thank you in advance
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
For an entry in cell A1, try this formula:
Code:
=MID(A1,7,2)&MID(A1,5,2)&MID(A1,3,2)&LEFT(A1,2)&"-"&MID(A1,12,2)&MID(A1,10,2)&MID(A1,14,LEN(A1))
 
Upvote 0
Depends if you had textjoin function:

=TEXTJOIN(,,MID(A1,{7,5,3,1},2),"-",MID(A1,{12,10},2),"-",MID(A1,{17,15},2),MID(A1,19,LEN(A1)))
 
Upvote 0
Hi Joe4

I have tried this which produces "b9336f1f-bc35-6d4b-8377-ca5fc024eae1". The second set of 4 characters "6d4b" also need reversing.

Can you help please?

Thank you
 
Upvote 0
If you have Excel 365 with the CONCAT function, this works:

Code:
=CONCAT(MID(A1,{7,5,3,1,9,12,10,14,17,15,19},{2,2,2,2,1,2,2,1,2,2,99}))
 
Upvote 0
Sorry, I missed that there were two sets of 4.

You already get better answers, but just to show you what that method I was using would look like, here it is:
Code:
=MID(A1,7,2)&MID(A1,5,2)&MID(A1,3,2)&LEFT(A1,2)&"-"&MID(A1,12,2)&MID(A1,10,2)&"-"&MID(A1,17,2)&MID(A1,15,2)&MID(A1,19,LEN(A1))
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,949
Members
448,534
Latest member
benefuexx

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