Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Formula for stripping text

I have a list of names, listed as LAST, FIRST, MI. The Middle initial is
optional, and I would like to remove it for the purpose of creating a lookup
from another table.

I have been doing Text to Columns and then CONCATENATE for the first 2
columns.
I was wondering if there is a way to do this with a function. Thanks in
advance.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Formula for stripping text

This checks to see if a middle initial is present, and leaves it out if true.

=IF(ISERROR(LEFT(A2,FIND(",",A2,FIND(",",A2)+1)-1)),A2,LEFT(A2,FIND(",",A2,FIND(",",A2)+1)-1))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Vicky" wrote:

I have a list of names, listed as LAST, FIRST, MI. The Middle initial is
optional, and I would like to remove it for the purpose of creating a lookup
from another table.

I have been doing Text to Columns and then CONCATENATE for the first 2
columns.
I was wondering if there is a way to do this with a function. Thanks in
advance.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Formula for stripping text

This may work, depending on consistency of a blank after the comma
=IF(MID(A3,LEN(A3)-3,1)=",",LEFT(A3,LEN(A3)-4),A3)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Vicky" wrote in message
...
I have a list of names, listed as LAST, FIRST, MI. The Middle initial is
optional, and I would like to remove it for the purpose of creating a
lookup
from another table.

I have been doing Text to Columns and then CONCATENATE for the first 2
columns.
I was wondering if there is a way to do this with a function. Thanks in
advance.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Formula for stripping text

Sorry, there is no comma between the FIRST and MI. Should I change your
commas to a space?

Name appears like this
Smith, Mary A

Thanks!



"Luke M" wrote:

This checks to see if a middle initial is present, and leaves it out if true.

=IF(ISERROR(LEFT(A2,FIND(",",A2,FIND(",",A2)+1)-1)),A2,LEFT(A2,FIND(",",A2,FIND(",",A2)+1)-1))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Vicky" wrote:

I have a list of names, listed as LAST, FIRST, MI. The Middle initial is
optional, and I would like to remove it for the purpose of creating a lookup
from another table.

I have been doing Text to Columns and then CONCATENATE for the first 2
columns.
I was wondering if there is a way to do this with a function. Thanks in
advance.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Formula for stripping text

that seemed to work

"Vicky" wrote:

Sorry, there is no comma between the FIRST and MI. Should I change your
commas to a space?

Name appears like this
Smith, Mary A

Thanks!



"Luke M" wrote:

This checks to see if a middle initial is present, and leaves it out if true.

=IF(ISERROR(LEFT(A2,FIND(",",A2,FIND(",",A2)+1)-1)),A2,LEFT(A2,FIND(",",A2,FIND(",",A2)+1)-1))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Vicky" wrote:

I have a list of names, listed as LAST, FIRST, MI. The Middle initial is
optional, and I would like to remove it for the purpose of creating a lookup
from another table.

I have been doing Text to Columns and then CONCATENATE for the first 2
columns.
I was wondering if there is a way to do this with a function. Thanks in
advance.



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Formula for stripping text

Try this:

=IF(LEFT(RIGHT(A1,2))=" ",LEFT(A1,LEN(A1)-2),A1)
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===


"Vicky" wrote in message
...
Sorry, there is no comma between the FIRST and MI. Should I change your
commas to a space?

Name appears like this
Smith, Mary A

Thanks!



"Luke M" wrote:

This checks to see if a middle initial is present, and leaves it out if
true.

=IF(ISERROR(LEFT(A2,FIND(",",A2,FIND(",",A2)+1)-1)),A2,LEFT(A2,FIND(",",A2,FIND(",",A2)+1)-1))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Vicky" wrote:

I have a list of names, listed as LAST, FIRST, MI. The Middle initial
is
optional, and I would like to remove it for the purpose of creating a
lookup
from another table.

I have been doing Text to Columns and then CONCATENATE for the first 2
columns.
I was wondering if there is a way to do this with a function. Thanks in
advance.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stripping nubers from text in a cell Dan S Excel Worksheet Functions 11 March 7th 08 02:34 AM
Stripping text from numbers in a cell Michael M Excel Worksheet Functions 10 July 13th 07 03:47 PM
Stripping text before a number (alpha or numeric) data_mattress Excel Worksheet Functions 10 April 12th 06 02:19 AM
Stripping section of text Philippe L. Balmanno Excel Worksheet Functions 3 December 30th 04 03:36 PM
Stripping mixed number and text Kevin Excel Worksheet Functions 2 December 9th 04 05:49 PM


All times are GMT +1. The time now is 11:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"