13-digit number in Excel

Rayman Blackz 20 Reputation points
2025-08-10T08:23:47.4166667+00:00

I need a to format my Excel spreadsheet to display my 13-digit number as follow: 000000 0000 000
The spaces in between. Even if the number is seen as text. No calculations are needed.

It is South Africa's Identity Number format.

Microsoft 365 and Office | Excel | For education | Windows
0 comments No comments
{count} votes

Accepted answer
  1. Tamara-Hu 1,950 Reputation points Microsoft External Staff Moderator
    2025-08-10T08:44:50.9+00:00

    Hi @Rayman Blackz,

    Thank you for posting your question on Microsoft Q&A forum.

    To format a 13-digit South African ID number in Excel as 000000 0000 000, even when treated as text, you can use a formula or custom formatting:

    Using a Formula

    If your 13-digit number is in cell A1, use this formula in another cell:

    =LEFT(A1, 6)&" "&MID(A1,7,4)&" "&RIGHT(A1,3)

    This breaks the number into three parts:

    • First 6 digits
    • Next 4 digits
    • Last 3 digits

    Using Custom Number Format

    If the number is stored as a number (not text), you can apply a custom format:

    1. Select the cells.
    2. Right-click → Format Cells.

    User's image

    1. Go to NumberCustom.
    2. Enter this format:
    000000" "0000" "000
    

    User's image

    Note: If the number is stored as text (e.g., starts with zero), Excel won’t apply number formatting. In that case, use the formula method.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. User's image

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Ashish Mathur 99,595 Reputation points Volunteer Moderator
    2025-08-10T23:20:27.9766667+00:00

    Hi,

    In cell B2, enter this formula

    =REGEXREPLACE(A2:A3,"(\d{6})(\d{4})(\d{3})","$1 $2 $3")

    Hope this helps.

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.