Solved

Excel - Cell  text splitting

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

Expert Comment

by:Ingeborg Hawighorst
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
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…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

685 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