Solved

Excel - Cell  text splitting

Posted on 2014-09-11
5
133 Views
Last Modified: 2014-09-11
Hi,

LASTNAME                     FIRSTNAME
BARGAS FORREA, JOSE LUIS (intern)
BARGAS FORREA, JOSE LUIS
OUSSAINT, JULI (EXTERN)
OUSSAINT, JULI (Z123456)
OUSSAINT, JULI

For Firstname i have  example:   BARGAS FORREA, JOSE LUIS (intern)
=RIGHT(B2,(LEN(B2))-(SEARCH(",",B2))-1)   the result is:  JOSE LUIS (INTERN)     should be JOSE LUIS

For Lastname i have  example:    BARGAS FORREA, JOSE LUIS (intern)
=LEFT(B9,(LEN(B9))-(SEARCH(",",B9))+0)    the result is :BARGAS FORREA, JOSE   should be  BARGAS FORREA

The formula should work with all given examples.  Is that possible?

Thanks in advance.
0
Comment
Question by:Mandy_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 500 total points
ID: 40316640
For First Name, will all data include the intern/extern in brackets?

If so:

=TRIM(MID(B9,FIND(",",B9,1)+1,FIND("(",B9,1)-FIND(",",B9,1)-1))

For last name, try using:

=MID(B9,1,(SEARCH(",",B9))-1)

In your example:

LEN(B9) = 33
SEARCH(",",B9) gives 14
33 - 14 = 19

The 19 leftmost characters includes ", JOSE"

Thanks
Rob H
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 40316646
If nothing in brackets:

=TRIM(MID(B9,FIND(",",B9,1)+1,IFERROR(FIND("(",B9,1)-FIND(",",B9,1)-1,LEN(B9))))
0
 
LVL 19

Expert Comment

by:helpfinder
ID: 40316658
what if you use Text to columns?
you will use delimiter to split cell. In first step you will use comma (,) so you split Last name from the rest. Because for some records you have brackets () you will do another Text to columns where delimiter is left bracket (. With this step you will get First name (in 1st step you get last name in A column, in this 2nd step you get First name in the B column). The rest placed in C column (text like INTERN, EXTERN, ####, ...) and you can delete this column if you do not need it.
0
 
LVL 50
ID: 40316659
Hello,

it might be easiest to use the Text to Column command on the data ribbon. First use the comma as the deliminator. This will split the last names and the first names. Then you can select the first names and use the text to columns to split at the  "(" sign. After that you can delete the column with the content that was in the brackets.
0
 
LVL 2

Author Closing Comment

by:Mandy_
ID: 40316677
perfect as usual. Thank you so much , rob
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question