Impossible Text Format

Gideon du Toit

New Member
Joined
May 22, 2023
Messages
29
Office Version
  1. 2010
Platform
  1. Windows
I have a column that needs to display ID numbers (string) in a certain format eg. 0012315184085 needs to be displayed as 001231 5184 085 following the "000000 0000 000" format. However, when I try to create this format Excel ignores the custom format and either displays the string in its original format or it displays it in this format "00 000 000 000 00" or something similar. I have searched the net for days now and there seems to be no solution. Is Excel unable to assign custom text formats? Will I have to write vb code JUST to put a text-based number in a certain format?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Custom number format codes don't work with text. If your codes are all numeric as in your example, you could convert them to real numbers, then apply a custom format.
 
Upvote 0
Hi & Welcome to MrExcel.

Try formatting it as "###### #### ###"
 
Upvote 0
Hi & Welcome to MrExcel.

Try formatting it as "###### #### ###"
Thanks for the response and the welcome. I did try to use the # in my conversation but it leaves out some of the "O" values. The number in the string is a South African citizen ID number, so every character has to be present and in a set format.
 
Upvote 0
Custom number format codes don't work with text. If your codes are all numeric as in your example, you could convert them to real numbers, then apply a custom format.
Thank you for your reply. I did try to convert it to a number, but that eliminates the leading zero's. The string in question is a South African citizen ID number, so the leading zero's refer to the date of birth. All of the characters need to be present in a particular format.
 
Upvote 0
Thank you for your reply. I did try to convert it to a number, but that eliminates the leading zero's. The string in question is a South African citizen ID number, so the leading zero's refer to the date of birth. All of the characters need to be present in a particular format.
Do not worry about the losing of the leading zeroes when converted to a number. When you appy the custom format of 000000 0000 000, it will add them back in, i.e.
1684776733445.png
 
Upvote 0

Forum statistics

Threads
1,215,108
Messages
6,123,129
Members
449,097
Latest member
mlckr

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