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!


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

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!
officetab bottom
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 · 1 years ago
    This doesn't work for two of the same capital letters
    • To post as a guest, your comment is unpublished.
      skyyang · 1 years 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 · 2 years ago
    Thanks for the content it really worked
  • To post as a guest, your comment is unpublished.
    Tom · 3 years ago
    Your formula fail if name is like this:

    JhonJhon
    MarkMark