How to Add Space between Numbers in Excel (3 Ways)

While working with numbers in Excel, you may need to insert space(s) between numbers to have a clear look. Sometimes, the numbers of a cell are too long. For that, it becomes difficult to read. Spaces between numbers give us a clear look at that cell or range of cells. In this tutorial, we are going to show you how to add space between numbers in Excel with suitable examples and proper illustrations.


Download Practice Workbook

Download this practice workbook.


3 Effective Approaches to Add Space between Numbers in Excel

To add space between numbers, we are going to demonstrate three effective methods that you can implement into your dataset. We recommend you learn and apply all these methods to your dataset. I hope it will solve your problem.

To demonstrate this tutorial, we are using the following dataset:

dataset of add space between numbers in excel

Here, we have a dataset consisting of some numbers. Now, our goal is to add space between the digits or a couple of digits of those numbers.

πŸ”— Read More: How to Remove Space in Excel before Numbers.

1. Use of Formulas to Add Space Between Numbers

Now, we will show four Excel formulas to insert space between numbers. All these formulas are composed of some Excel functions. Now, if you don’t have many ideas about these functions, click the links to those functions. Surely, it will come in handy in the future.

1.1 Use of the REPLACE Function

In Microsoft Excel, we use the REPLACE function to replace a specific portion of a text. The replacement performs based on the starting number, number of characters, and the text you want to add. We are going to use this function to denote the position of that space and insert that.

The Generic Formula:

=REPLACE(old_text,start_num,num_chars,” β€œ)

Now, from the dataset, we are going to add space in the middle of the numbers.

πŸ“Œ Steps

1. First, type the following formula in Cell C5:

=REPLACE(B5,4,0," ")

replace function to add space between numbers in excel

2. Then, press Enter.

result of replace function in excel

3. After that, drag the Fill Handle icon over the range of cells C6:C10.

excel add space between numbers

As you can see, we have successfully added space between those numbers.

1.2 Use of the CONCATENATE, LEFT, and RIGHT Functions

Now, this formula is a combination of three Excel functions. If we want to add any space at a particular place, we need to calculate the position from both the right and left sides. The LEFT function will count the position from the left and extract numbers. The RIGHT function will count from the right and will extract it. In the middle of those numbers, we will add a space. And finally, the CONCATENATE function will merge them all.

The Generic Formula:

=CONCATENATE(LEFT(text,[num_chars])&” β€œ&RIGHT(text,[num_chars]))

Now, from the dataset, we are going to add space in the middle of the numbers.

πŸ“Œ Steps

1. First, type the following formula in Cell C5:

=CONCATENATE(LEFT(B5,3)&" "&RIGHT(B5,3))

concatenate function to add space between numbers

2. Then, press Enter.

result of concatenate function in excel

3. After that, drag the Fill Handle icon over the range of cells C6:C10.

spcae between numbers after using concatenate function

In the end, you can see there are spaces in the middle of these numbers.

πŸ”Ž How Does the Formula Work?

We are doing this breakdown for Cell B5

➀ LEFT(B5,3)

This function returns: 133

➀ RIGHT(B5,3)

This function returns: 546

➀ CONCATENATE(LEFT(B5,3)&" "&RIGHT(B5,3))

Finally, the CONCATENATE function will return: 133 546

1.3 Use of the MID Function along with CONCATENATE, LEFT, and RIGHT

If you want to separate the numbers into three parts or more, you can add the MID function in the previous formula. How to do that? Follow the steps below!

πŸ“Œ Steps

1. First, type the following formula in Cell C5:

=CONCATENATE(LEFT(B5,2)&" "&MID(B5,3,2)&" "&RIGHT(B5,2))

using concate and mid function to add space

2. Then, press Enter.

result of concatenate and mid function

3. After that, drag the Fill Handle icon over the range of cells C6:C10.

drag the fill handle to copy the formula


Related Content: How to Add Space between Rows in Excel

πŸ”Ž How Does the Formula Work?

We are doing this breakdown for Cell B5

➀ LEFT(B5,2)

This function returns : 13

➀ MID(B5,3,2)

This function returns :Β 35

➀ RIGHT(B5,2)

This function returns : 46

➀ CONCATENATE(LEFT(B5,2)&" "&MID(B5,3,2)&" "&RIGHT(B5,2))

Finally, the CONCATENATE function will return: 13 35 46

1.4 Use of the TEXT Function

Now, we are using the TEXT function to change the format. You can add spaces between numbers. It will change the general format of that number.

We have two ways of doing that. The first one is the format β€œ## ## ##” and the other one is β€œ00 00 00β€œ. You can choose any of that and implement this to your dataset. It will return you a similar result.

The Generic Formula:

=TEXT(value,”## ## ##”)

Or,

=TEXT(value,”00 00 00β€³)

We are going to separate the numbers into three parts using spaces.

πŸ“Œ Steps

1. First, type the following formula in Cell C5:

=TEXT(B5,"## ## ##")

Or,

=TEXT(B5,"00 00 00")

text function to add space between numbers in excel

Note: As the numbers in our dataset have 6 digits each, and we want to insert a space after every 2 digits, we have used β€œ## ## ##” or, β€œ00 00 00”. The format will depend on the number of digits, space positions, etc.

2. Then, press Enter.

result after typing text function in excel

3. After that, drag the Fill Handle icon over the range of cells C6:C10.

space between numbers in excel

As you can see, we have inserted spaces and separated the numbers into three parts.

1.5 Use of the TEXT, LEN, and REPT Functions

Here, this formula is a combination of three functions. Earlier, we discussed the TEXT function. The LEN function gives us the length of any cell values. And the REPT function is generally used to repeat a text or a character a defined number of times in a cell.

The Generic Formula:

=TEXT(value,REPT(β€œ0 β€œ,LEN(text)))

We are going to add spaces after every single number using this formula.

πŸ“Œ Steps

1. First, type the following formula in Cell C5:

=TEXT(B5,REPT("0 ",LEN(B5)))

using the TEXT, LEN and REPT functions together to add space

2. Then, press Enter.

result after using the formula

3. After that, drag the Fill Handle icon over the range of cells C6:C10.

space after each digit in excel

As you can see, we have added spaces after every single number.

πŸ”Ž How Does the Formula Work?

We are doing this breakdown for Cell B5

➀ LEN(B5)

This function returns: 6

➀ REPT("0 ",LEN(B5))

This function returns : 0 0 0 0 0 0Β 

➀ TEXT(B5,REPT("0 ",LEN(B5)))

Finally, our number will be: 1 3 3 5 4 6Β 


2. Using Number Formatting to Add Space Between Numbers

Now, this method is pretty simple to use. This method works like the TEXT function we discussed earlier. We will give our numbers a format. We can use spaces here between numbers.

πŸ“Œ Steps

1. First, select the range of cells B5:B10.

select the range to add space

2. Then, go to Home Tab. You can find a dropdown menu there. Click on that.

3. Select More Number Formats.

number format in home tab

4. Then, click on Custom.

click on custom

5. In the Type box, type 00 00 00. You can also see the sample above.

type the number format with space

6. Click on OK.

spaces between the numbers

Here, you can see spaces between numbers. They are divided into three parts.


3. Using VBA Codes to Append Space Between Numbers in Excel

Now, if you know about Excel’s VBA codes, this method will surely work for you. We are providing you with two VBA codes.

3.1 Add Space after Each Digit

This method will add a space after each digit as we did with formulas.

πŸ“Œ Steps

1. First, press ALT+F11 on your keyboard to open the VBA editor.

2. Click on Insert > Module.

insert module on vba editor

3. Then, type the following code:

Sub InsertSpace()
Dim r As Range
Application.ScreenUpdating=False
For Each r In Range("B5",Range("B"&Rows.Count).End(xlUp))
r=Trim(Replace(StrConv(r,vbUnicode),Chr(0)," "))
Next r
Columns("B").AutoFit
Application.ScreenUpdating=True
End Sub

4. Now, select the range of cells B5:B10.

select the range of cells to add space

5. Then, press ALT+F8. It will open the Macro dialog box.

open macro dialog box

6. Click on Run.

run macro to add space

After that, you will see added spaces after each digit.

space after each digit between numbers

3.2. Add Space According to User’s Choice

Now, this formula is much useful and effective. You can add space in any position according to your choice. In the user-defined function, all you have to do is choose the cell and the position of the space.

πŸ“Œ Steps

1. First, press ALT+F11 on your keyboard to open the VBA editor.

2. Click on Insert > Module.

3. Then, type the following code:

Function Space(cell As Range,position As Integer)
Space=Left(cell.Value,position)& " "&Right(cell.Value,Len(cell.Value)-position)
End Function

4. First, type the following formula in Cell C5:

=Space(B5,2)

enter the user defined function

5. Then, press Enter. You will see the space after the second position.

result after entering the user defined function

Finally, you can do the same for all numbers with different positions.

excel add space between numbers in excel


πŸ’¬ Things to Remember

✎  In the first VBA code, you can add only one space.

✎  In the TEXT function, your format should be the same number of characters as the numbers. Otherwise, it will add a zero before them.


Conclusion

To conclude, I hope this tutorial will help you to add space between numbers in Excel. We recommend you learn and apply all these methods to your dataset. Download the practice workbook and try these yourself. Also, feel free to give feedback in the comment section. Your valuable feedback keeps us motivated to create tutorials like this. Don’t forget to check our website Exceldemy.com for various Excel-related problems and solutions.


Further Reading:

Shanto

Hello! I am Shanto. An Excel & VBA Content Developer. My goal is to provide our readers with great tutorials on various Excel-related problems. I hope our easy but effective tutorials will enrich your knowledge. I have completed my BSc in Computer Science & Engineering from Daffodil International University. Working with data was always my passion. Love to work with data, analyze those, and find patterns. Also, love to research. Always look for challenges to keep me growing.

We will be happy to hear your thoughts

Leave a reply

ExcelDemy
Logo