Solved

Excel - Cell  text splitting

Posted on 2014-09-11
5
126 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_
5 Comments
 
LVL 31

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 31

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

Expert Comment

by:teylyn
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now