Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to split text into separate columns by capital letter in Excel?

doc split by capital 1

Supposing, you have a range of data that you want to split the cell contents into separate columns by the capital letter as the following screenshot shown, do you have any good ideas to solve this problem in Excel?

Split text into separate columns by capital letter with formulas

Split text into separate columns by capital letter with VBA code

Split text into separate columns by capital letter with Kutools for Excel



If there are only two words in your cells, the following formulas help you to finish this job. Please do as follows:

1. Enter this array formula: =LEFT(A2,SMALL(FIND(CHAR(ROW(INDIRECT("65:90"))),A2&"ABCDEFGHIJKLMNOPQRSTUVWXYZ"),2)-1) (A2 is the cell that you want to split by capital letter) into a blank cell which adjacent to your data, and then press Ctrl + Shift + Enter keys together to get the first word, see screenshot:

doc split by capital 2

2. Then select C2, and drag the fill handle down to the cells that you want to apply this formula, all the first words of the range cells have been extracted at once, see screenshot:

doc split by capital 3

3. Go on entering another formula: =REPLACE(A2,1,LEN(C2),"") (A2 is the cell that you want to split, and C2 is the cell contains the first word that you have returned) into cell D2, and press Enter key to get the second word, see screenshot:

doc split by capital 4

4. Select cell D2, drag the fill handle down to the cells to get the second word, and the cell contents of the range have been split into two columns by the capital letter, see screenshot:

doc split by capital 5


The above formulas only are applied to the cell value which contains two words, if there are multiple words in a cell needed to be split, you can add spaces before the capital letters, and then apply the Text to Columns to split the cell contents into separate columns by space.

First, apply VBA code to add spaces before the capital letter to separate the words.

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Insert spaces before each capital letter in a cell

Function SplitWords(ByVal Str As String) As String
'updateby Extendoffice 20151128
    Dim I As Integer
    SplitWords = Left(Str, 1)
    For I = 2 To Len(Trim(Str))
        If (Asc(Mid(Str, I, 1)) > 64) And _
           (Asc(Mid(Str, I, 1)) < 91) And _
           (Mid(Str, I - 1, 1) <> " ") Then _
            SplitWords = SplitWords & " "
        SplitWords = SplitWords & Mid(Str, I, 1)
    Next
End Function

3. Save and close this code, go back to the worksheet, please enter this formula: =splitwords(A2) into a blank cell adjacent your data, see screenshot:

doc split by capital 6

4. Then drag the fill handle down to the cells that you want apply this formula, and the spaces have been inserted before each capital letter to separate the cell contents, see screenshot:

doc split by capital 7

5. And then you should copy and paste theses formula cells as values to remove the formulas in another place or the original range.

doc split by capital 8

Second, apply the Text to Column feature to split the cell contents into separate columns by the space.

6. Select the cell values you have inserted spaces, and click Data > Text to Columns, in Step1 of the Convert Text to Columns Wizard, select Delimited option, see screenshot:

doc split by capital 9

7. Then click Next button, in Step2 of the wizard, check Space option under the Delimiters section, see screenshot:

doc split by capital 10

8. Go on clicking Next button, in Step3 of the wizard, choose General option under the Column data format, and then select a cell where you want to put the split values by clicking doc split by capital 12 button, see screenshot:

doc split by capital 11

9. At last, click Finish button, the cell contents have been split into multiple columns as following screenshot shown:

doc split by capital 13


If you have Kutools for Excel, combining its Add Text and Split Cells features, you can deal with this task easily and comfortably, please do as follows:

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.

1. Select the original data that you want to split.

2. Then click Kutools > Text > Add Text, see screenshot:

doc split by capital 14

3. In the Add Text dialog box, please type the space bar once or any other separator you need into the Text box, and then choose 1 st letter is uppercase from the Only add to section, see screenshot:

doc split by capital 15

4. Then click Ok button, and spaces have been added before each capital letter, see screenshot:

doc split by capital 16

5. And then you can apply the Split Cells utility of Kutools for Excel to split the cell values by space, keeping the data range selected and then click Kutools > Text > Split Cells, see screenshot:

doc split by capital 17

6. In the Split Cells dialog box, select Split to Columns under the Type section, and check Space or other delimiters that you added in Step 3, see screenshot:

doc split by capital 18 18

7. Then click Ok, and a prompt box is popped out to remind you select a cell to put the split data, see screenshot:

doc split by capital 19

8. At last, click OK button, and you will get the result you need, see screenshot:

doc split by capital 20

Download and free trial Kutools for Excel Now !


Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    guest · 9 months ago
    This doesn't work for two of the same capital letters
    • To post as a guest, your comment is unpublished.
      skyyang · 9 months ago
      Hello,
      If the two words are same words, please change the first array formula to the follows:
      =LEFT(A2,SMALL(FIND(CHAR(ROW(INDIRECT("65:90"))),RIGHT(A2, LEN(A2)-1)&"ABCDEFGHIJKLMNOPQRSTUVWXYZ"),1))

      Please remember to press Ctrl + Shift + Enter keys together.

      Hope it can help you!
  • To post as a guest, your comment is unpublished.
    sdf · 1 years ago
    Thanks for the content it really worked
  • To post as a guest, your comment is unpublished.
    Tom · 2 years ago
    Your formula fail if name is like this:

    JhonJhon
    MarkMark