Text Split with Excel Formula – Part II

December 22, 2008

Hi friends,

Here goes the Text Split formula Part II, which will explain how to split First Name, Middle Name and Last Name.

Of course, you can use this many other ways too, so try to understand the logic behind this.

Formulas Used:

Just like previous part, we are also going to use Left, Right & find formulas.

All the three formulas are much simple to use and the real magic is binding them together to get desired results.

LOGIC:

In the first part, we had used find to determine the location of space between two words and then we split it with left & right.

Now in this part we are going to find out further how to find out second space in the given string.

Situation:

If you have a string ‘Firstname Middlename Lastname’, in A3 how you will separate this text with formulas so that you will have firstname, middlename and lastname in separate columns.

Firstname:

Very easy just like what we did in the last part find out the place of separator and use left function.

The formula for the given example is…=LEFT(A3,FIND(” “,A3,1))

Middlename:

This is most interesting part that everybody wants. Here you need to use all the three functions together. First you find out 2nd location of separator and using left formula you will get string ‘firstname middlename’. Then using right formula as in part one you can separate middlename. As this is quiet complicated I will explain this step by step and then together.

Step 1: Find 2nd location of separator formula is … =FIND(” “,A3,FIND(” “,A3,1)+1)

Note: remember to add ‘1′ to last separator location to find out next, otherwise it will keep giving you same results.

Step 2: Find string ‘firstname middlename’ formula is … =LEFT(A3,FIND(” “,A3,FIND(” “,A3,1)+1))

Step 3: Use ‘Right’ function to separate middlename from string in step 2, formula is…=RIGHT(LEFT(A3,FIND(” “,A3,FIND(” “,A3,1)+1)),FIND(” “,A3,1))

Lastname:

Comparatively this is easy, and similar to what we did in last part the only difference is instead of 1st location of separator we are going to use last location of separator.

The formula for the given example is… =RIGHT(A3,LEN(A3)-FIND(” “,A3,FIND(” “,A3,1)+1))

Conclusion:

This way you can split ‘n’ number words with any given separator. Try to find out way to use string functions differently it has enormous power.

Please add your feedback and comments below.

Entry Filed under: Excel, Formula, MS EXCEL, MSEXCEL. Tags: , , , , , , , .

4 Comments Add your own

  • 1. Vani  |  March 9, 2009 at 6:33 am

    Hi,

    How to seperate the Last Name and first Name in the same text given?

    Reply
  • 3. Tweety22  |  November 5, 2009 at 11:18 am

    my requirement is how to split alpha numeric characters i.e at times it will be numbers followed by an alphabet (eg) K456 and at times it will be an alphabet followed by numbers (eg) 456L. How to split these separately as split up of this alpha numeric character is the base for a complicated calculation.I tried using the split forename & surname but it works only when there is a space between the numbers and the alphabet, otherwise i get an error msg.
    I need this quiet urgently. Kindly provide the formula as well since am not technically sound.

    Many Thanks in advance

    Reply
    • 4. rshewade  |  November 8, 2009 at 12:33 pm

      Buddy there is not such formula but you can build one. You need to visit rentacoder.com

      Also as I mentioned this BLOG is for them who already has knowledge of excel not for ‘technically UNsound’

      Reply

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Archives

Recent Comments

rshewade on Text Split with Excel Formula …
Tweety22 on Text Split with Excel Formula …
rotem on Excel Function – LA…
rshewade on Text Split with Excel Formula …
arindam on Text Split with Excel Formula …

Blog Stats

Tags

Advanced Conditional Formatting Excel excel functions Formula Functions help Large MS EXCEL MSEXCEL Named Ranges pivot table PivotTable ranges rare Shortcut Keys Table Formatting text text formula text separate text split tips Top10 tricks Useful Zebra Stripes

Recent Posts

Blogroll