Solved

Excel - Cell  text splitting

Posted on 2014-09-11
5
132 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

737 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