automatic spacing between 4 characters

frostiak

New Member
Joined
Jul 11, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I need help in an online worksheet that I share with colleagues. We need to write down codes of 16 characters, all spaced between every 4 characters (e.g. a111 1a1a 1111 aa1a). It would be amazing if I could just put down 16 characters, and it spaces each 4 automatically for me. I can do this with just numbers or just letters, but not with the combination of both which I do need. Could anyone help me with this? Thank you so much in advance.

Kind regards,
frostiak
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Assuming your 16 character string is in A1, you could use the following in perhaps B1 for example:

=LEFT(A1,4) & " " & MID(A1,5,4) & " " & MID(A1,9,4) & " " & MID(A1,13,4)

You could then drag that formula down the column.
 
Upvote 0
Here is another formula that you can also consider...

=REPLACE(REPLACE(REPLACE(A1,13,0," "),9,0," "),5,0," ")
 
Upvote 0
Solution
Hey guys, thank you so much for the solutions! Much appreciated. Have a nice day!
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,753
Members
449,094
Latest member
dsharae57

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