splitting text in cells

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Splitting Text In Cells

Splitting Text In Cells

resolvedResolved · Low Priority · Version Standard

Julia has attended:
Excel Consulting course
Excel Consulting course

Splitting Text In Cells

Hi

I have a column containing peoples full names eg Julia Foster.

How can I split these into first and last names in adjacent cells.

Julia

RE: Splitting Text In Cells

Hi Julia

To split a a persons full name in a cell use the following code:

If the Name is in cell A1 then enter code as followis in the adjacent cells:

In B1 enter =LEFT(A1,FIND(" ",A1)-1)

The LEFT function returns all characters in a string starting from the left to a defined number.

The FIND function returns the position of the space. This indicates to the LEFT function how many characters to display

By placing the -1 after the bracket we are telling the LEFT function to return the first name BUT NOT include the Space.

In C1 enter =MID(A2,FIND(" ",A2)+1,100)

The MID function returns all characters in a string starting from a predefined position in a string.

The FIND function returns the position of the space. This indicates to the MID function from where to start displaying the rest of the text.

By placing the +1 after the bracket in the middle section we are telling the MID function to return the last name BUT NOT include the Space. The 100 is to indicate how far to display the text. It allows for a very long name.

I have attached a spreadsheet as an example.

Hope this helps

Carlos

Attached files...

Split Names into two cells.xls


 

Excel tip:

Switch on smart tags – Excel 2007

In order to use smart tags, make sure they are turned on, to do this:
1. Click on ‘Microsoft Office‘ button and then click on ‘Excel Options‘.
2. Click on ‘Proofing‘ category and then click on ‘Auto Correct Options‘.
3. In the ‘Auto Correct‘ dialogue box appears, click the ‘Smart Tags‘ Tab.
4. Tick the boxes, next to the Smart Tags you wish to use in Excel

View all Excel hints and tips


Server loaded in 0.08 secs.