How to add space between first name and last name in Excel?
Here is a list of names which needs spaces added to separate them, as shown in the screenshot below. How can you quickly solve it?
Add space between first name and last name with a Defined Function
Add space between first name and last name with Kutools for Excel
Add space between first name and last name with a Defined Function
To add space between the first name and last name, you can only use a Defined Function to solve this in Excel.
1. Press Alt + F11 keys to open Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste below code to the blank script.
Code: Add space between names
Function AddSpaces(pValue As String) As String
'UpdatebyExtendoffice20160908
Dim xOut As String
xOut = VBA.Left(pValue, 1)
For i = 2 To VBA.Len(pValue)
xAsc = VBA.Asc(VBA.Mid(pValue, i, 1))
If xAsc >= 65 And xAsc <= 90 Then
xOut = xOut & " " & VBA.Mid(pValue, i, 1)
Else
xOut = xOut & VBA.Mid(pValue, i, 1)
End If
Next
AddSpaces = xOut
End Function
3. Save the code and close the Applications window, select a blank cell and enter this formula =AddSpaces(A1), then drag autofill handle over cells you want to apply this formula.
Add space between first name and last name with Kutools for Excel
If you are not familiar with Defined Function, you can apply Kutools for Excel’s Add Text utility to quickly add space between first name and last name.
1. Select the cells you want to add spaces, click Kutools > Text > Add Text. See screenshot:
2.In the Add Text dialog, enter a space into the Text box, check the Only add to option, and select Before uppercase letters from the drop down list. See screenshot:
3. Click Ok or Apply, now a space has been added before each uppercase letter. See screenshot:
Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now
Demo: Add Spaces Between Names with Kutools for Excel
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.





- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in