Skip to main content

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

Author: Xiaoyang Last Modified: 2024-09-13
split text into separate columns by capital letter

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


Split text into separate columns by capital letter with formulas

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:

use a fromula to  to get the first word

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:

drag and fill the formula to other cells

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:

use a fromula to  to get the second word

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:

drag the formula to other cells

a screenshot of kutools for excel ai

Unlock Excel Magic with Kutools AI

  • Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
  • Custom Formulas: Generate tailored formulas to streamline your workflows.
  • VBA Coding: Write and implement VBA code effortlessly.
  • Formula Interpretation: Understand complex formulas with ease.
  • Text Translation: Break language barriers within your spreadsheets.
Enhance your Excel capabilities with AI-powered tools. Download Now and experience efficiency like never before!

Split text into separate columns by capital letter with VBA code

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:

enter a user defined function to add spaces before the capital letter

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:

 the spaces have been inserted before each capital letter

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

copy and paste theses formula cells as values

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:

click Data > Text to Columns, and choose Delimited option

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

check Space option under the Delimiters section

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 select button button, see screenshot:

specify options in the dialog box

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

cell contents have been split into multiple columns


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

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 offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

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

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

click Add Text feature of kutools

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:

set options in the dialog box

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

spaces have been added before each capital letter

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 > Merge & Split > Split Cells, see screenshot:

click Split Cells feature of kutools

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:

select Space or other delimiters

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

select a cell to put the split data

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

the cells are split by capital letters

Download and free trial Kutools for Excel Now !

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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!