Function similar to "LEFT"

  • Follow


I'm trying to separate the last name from the first name in a field.  I can 
get the first name by using the "left" function.  Does anyone know how to get 
the last name?  I tried using "right" function but on some it gives me the 
whole last name plus part of the first name, others it gives me some of the 
letters of the last name.  Please advise - thanks!
0
Reply Utf 4/15/2010 8:57:01 PM

Karen, Have a look at using <data> <text to columns> You van use the space 
as a separator.
-- 
Greetings from New Zealand



"Karen D" <KarenD@discussions.microsoft.com> wrote in message 
news:37113207-F5A3-4A6C-831E-F5AD54203D90@microsoft.com...
> I'm trying to separate the last name from the first name in a field.  I 
> can
> get the first name by using the "left" function.  Does anyone know how to 
> get
> the last name?  I tried using "right" function but on some it gives me the
> whole last name plus part of the first name, others it gives me some of 
> the
> letters of the last name.  Please advise - thanks! 


0
Reply Bill 4/15/2010 9:04:01 PM


This won't work for everything (Jr., Sr., De La Hoya, etc.),
but should work for most:

=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),99))
-- 
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Karen D" <KarenD@discussions.microsoft.com> wrote in message 
news:37113207-F5A3-4A6C-831E-F5AD54203D90@microsoft.com...
> I'm trying to separate the last name from the first name in a field.  I 
> can
> get the first name by using the "left" function.  Does anyone know how to 
> get
> the last name?  I tried using "right" function but on some it gives me the
> whole last name plus part of the first name, others it gives me some of 
> the
> letters of the last name.  Please advise - thanks! 


0
Reply RagDyer 4/15/2010 11:14:24 PM

You should have posted few examples. I assume the firstname and last name is 
separated by a space

For example to extract 'Karen' from 'Karen D' you can use

=LEFT(A1,FIND(" ",A1)-1)

But if you have names without lastnames then modify the formula as below
A1 = 'Karen D'
B1=LEFT(A1 & " ",FIND(" ",A1 & " ")-1)
C1=MID(A1,LEN(B1)+2,255)

-- 
Jacob (MVP - Excel)


"Karen D" wrote:

> I'm trying to separate the last name from the first name in a field.  I can 
> get the first name by using the "left" function.  Does anyone know how to get 
> the last name?  I tried using "right" function but on some it gives me the 
> whole last name plus part of the first name, others it gives me some of the 
> letters of the last name.  Please advise - thanks!
0
Reply Utf 4/16/2010 5:28:01 AM

3 Replies
250 Views

(page loaded in 0.061 seconds)

Similiar Articles:
















7/28/2012 6:00:10 PM


Reply: