Format numbers and symbols with trailing spaces

Martin_H

Board Regular
Joined
Aug 26, 2020
Messages
190
Office Version
  1. 365
Platform
  1. Windows
Hi team,

random cell in Excel contains this text: 97A346V21ANQ (as you can see there are numbers and letters). I would like to see it like this: 97A 346 V21 ANQ (mind the gaps).

Would it be possible to create a custom format?

Thank you.
 

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
Hi,​
yes just combining the character @ and the space …​
 
Upvote 0
Well that copies the entire sentence according to the number of @ symbols used.
 
Upvote 0
Your initial post was not enough explicit : so now for a partial text within a sentence I can't see any cell format solution …​
 
Upvote 0
Your initial post was not enough explicit : so now for a partial text within a sentence I can't see any cell format solution …
Nonsense! You just didn't pay attention to the question, posted something without testing it, and now you're trying to shift the blame to the OP. If you're going to respond to posts on the forum then please do so with due care. Many people skip over threads with replies and so you're doing the OP a disservice by not making a proper effort to help.

@Martin_H - as far as I know it can't be done with custom number format. If I can point you toward a formula suggestion, this may work if you are splitting segments of three characters of a 12 character string.

Using REPLACE():
Excel Formula:
=REPLACE(REPLACE(REPLACE(A1,4,0," "),8,0," "),12,0," ")

With TEXTJOIN function (I don't think you have this):
Excel Formula:
=TEXTJOIN(" ",TRUE,MID(A1,1*{1;4;7;10},3))
 
Last edited:
Upvote 0
Solution
Nonsense! You just didn't pay attention to the question, posted something without testing it, and now you're trying to shift the blame to the OP. If you're going to respond to posts on the forum then please do so with due care. Many people skip over threads with replies and so you're doing the OP a disservice by not making a proper effort to help.

@Martin_H - as far as I know it can't be done with custom number format. If I can point you toward a formula suggestion, this may work if you are splitting segments of three characters of a 12 character string.

Using REPLACE():
Excel Formula:
=REPLACE(REPLACE(REPLACE(A1,4,0," "),8,0," "),12,0," ")

With TEXTJOIN function (I don't think you have this):
Excel Formula:
=TEXTJOIN(" ",TRUE,MID(A1,1*{1;4;7;10},3))
Perfect! Thank you very much.
 
Upvote 0
Sorry as I could not test as this time and I confused with the VBA Format function where the character @ well works for the formatting​
so it can be also easily achieved via an UDF or a classic VBA procedure …​
 
Upvote 0

Forum statistics

Threads
1,215,007
Messages
6,122,670
Members
449,091
Latest member
peppernaut

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