Formula to add a ":" after every 2 characters in a cell?

suncandle

New Member
Joined
May 12, 2009
Messages
4
Hi Everyone,
I have searched online and in help but can't seem to find the best solution...

I have values like 00904BB303D6 that need to become: 00:90:4B:B3:03:D6 (the value is always 12 digits, and the : needs to appear every two digits.) Is there a formula that can easily do this for me? Your suggestions are greatly appreciated!

Thanks in advance!!!!
 
Hi, welcome to the forum!

You could remove some of the maths from the SEQUENCE and MID() functions if you wanted, like this.
Excel Formula:
=TEXTJOIN(":";1;MID(A1;SEQUENCE(LEN(A1);;;2);2))
Thanks! Yes, your formula is much better. But LEN(A1)/2 is still more correct.
 
Upvote 0
Since we are looking at alternatives with newer Excel versions, & given the original specs that the strings had an even number of digits, with 365 this would now be an option.

25 02 10.xlsm
AB
100904BB303D600:90:4B:B3:03:D6
Every 2
Cell Formulas
RangeFormula
B1B1=TEXTJOIN(":",,REGEXEXTRACT(A1,"..",1))
 
Upvote 0

Forum statistics

Threads
1,226,884
Messages
6,193,502
Members
453,804
Latest member
Daniel OFlanagan

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