Add spaces to long number string

YLand

New Member
Joined
Oct 25, 2023
Messages
7
Office Version
  1. 2010
Platform
  1. Windows
Hello, the account number in the cell looks like: 300E23411130001000000. I need it to have spaces like: 300 E 23 4111 30 001 0 00 0 00. I've done it using LEFT, RIGHT AND MID before, but I can't remember how. I have a large report that I need to format this way. I am using Excel 16. Thank you in advance.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Combine your LEFT, RIGHT, and MID functions with spaces.

So, if the value was in cell A1, the formula would start like this:
Excel Formula:
=LEFT(A1,3) & " " & MID(A1,4,1) & " " & MID(A1,5,2) & " " & ...
You should be able to pick up on the pattern and complete the rest.
 
Upvote 0
Hi,

would this work for you, assuming data is in cell A1 ?

Excel Formula:
=LEFT(A1,3)&" "&MID(A1,4,1)&" "&MID(A1,5,2)&" "&MID(A1,7,4)&" "&MID(A1,11,2)&" "&MID(A1,13,3)&" "&MID(A1,16,1)&" "&MID(A1,17,2)&" "&MID(A1,19,1)&" "&MID(A1,20,2)
 
Upvote 0
Solution
Combine your LEFT, RIGHT, and MID functions with spaces.

So, if the value was in cell A1, the formula would start like this:
Excel Formula:
=LEFT(A1,3) & " " & MID(A1,4,1) & " " & MID(A1,5,2) & " " & ...
You should be able to pick up on the pattern and complete the rest.
That's the one! Thank you so much!
 
Upvote 0
Hi,

would this work for you, assuming data is in cell A1 ?

Excel Formula:
=LEFT(A1,3)&" "&MID(A1,4,1)&" "&MID(A1,5,2)&" "&MID(A1,7,4)&" "&MID(A1,11,2)&" "&MID(A1,13,3)&" "&MID(A1,16,1)&" "&MID(A1,17,2)&" "&MID(A1,19,1)&" "&MID(A1,20,2)
You just saved me an hour of googling! Thank you so much!
 
Upvote 0
You are welcome.
Glad we were able to help.
 
Upvote 0
indeed, thanks a lot for the feedback.
cheers
Rob
 
Upvote 0

Forum statistics

Threads
1,215,086
Messages
6,123,038
Members
449,092
Latest member
ikke

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