+ Reply to Thread
Results 1 to 16 of 16

Remove middle initial from "first name middle initial"

  1. #1
    Justin F.
    Guest

    Remove middle initial from "first name middle initial"

    Hello Excel Gurus,

    I've been searching the site for an answer to this question but as yet no
    luck. If I missed a previous post on this topic I apologize, please direct me
    to it.

    I have 1 column with a series of people's first names. Many have a middle
    initial, some don't. About half of the cells are of two people's names joined
    by an "&". Sample data below:

    Frank & Debbie J
    Marshall & Teresa
    Timothy R
    Jeffrey D & Eileen N
    Pamela J
    James R & Rachel
    Brooke S
    Myung S
    Martin F & Susan A
    Kathleen

    I need remove the middle initial and preserve the first names and the "&"
    with a single space between the names and the "&". Can anyone provide me with
    a way to do this?

    Many thanks in advance,
    Justin F.


  2. #2
    Max
    Guest

    Re: Remove middle initial from "first name middle initial"

    One way to try ..

    Assuming the data is n A2 down,

    Put in B2, and copy down:
    =IF(OR(ISNUMBER(SEARCH("&",A2)),NOT(ISNUMBER(SEARCH("
    ",A2)))),A2,LEFT(A2,SEARCH(" ",A2)-1))

    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----
    "Justin F." <Justin [email protected]> wrote in message
    news:[email protected]...
    > Hello Excel Gurus,
    >
    > I've been searching the site for an answer to this question but as yet no
    > luck. If I missed a previous post on this topic I apologize, please direct

    me
    > to it.
    >
    > I have 1 column with a series of people's first names. Many have a middle
    > initial, some don't. About half of the cells are of two people's names

    joined
    > by an "&". Sample data below:
    >
    > Frank & Debbie J
    > Marshall & Teresa
    > Timothy R
    > Jeffrey D & Eileen N
    > Pamela J
    > James R & Rachel
    > Brooke S
    > Myung S
    > Martin F & Susan A
    > Kathleen
    >
    > I need remove the middle initial and preserve the first names and the "&"
    > with a single space between the names and the "&". Can anyone provide me

    with
    > a way to do this?
    >
    > Many thanks in advance,
    > Justin F.
    >




  3. #3
    Max
    Guest

    Re: Remove middle initial from "first name middle initial"

    Or, maybe better to wrap TRIM() around the source data in col A,

    Put in B2, and copy down:

    =IF(OR(ISNUMBER(SEARCH("&",TRIM(A2))),NOT(ISNUMBER(SEARCH("
    ",TRIM(A2))))),TRIM(A2),LEFT(TRIM(A2),SEARCH(" ",TRIM(A2))-1))

    [same formula as before, but with "TRIM(A2)" replacing "A2"]
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----



  4. #4
    Ron Rosenfeld
    Guest

    Re: Remove middle initial from "first name middle initial"

    On Thu, 23 Jun 2005 18:02:02 -0700, Justin F. <Justin
    [email protected]> wrote:

    >Hello Excel Gurus,
    >
    >I've been searching the site for an answer to this question but as yet no
    >luck. If I missed a previous post on this topic I apologize, please direct me
    >to it.
    >
    >I have 1 column with a series of people's first names. Many have a middle
    >initial, some don't. About half of the cells are of two people's names joined
    >by an "&". Sample data below:
    >
    >Frank & Debbie J
    >Marshall & Teresa
    >Timothy R
    >Jeffrey D & Eileen N
    >Pamela J
    >James R & Rachel
    >Brooke S
    >Myung S
    >Martin F & Susan A
    >Kathleen
    >
    >I need remove the middle initial and preserve the first names and the "&"
    >with a single space between the names and the "&". Can anyone provide me with
    >a way to do this?
    >
    >Many thanks in advance,
    >Justin F.
    >


    Assuming your formats are exactly as you show, with only a single space around
    the "&" and before and/or after the Initials, then the following formula will
    do what you describe on your data set:

    =IF(ISERROR(SEARCH(" ? &",IF(ISERROR(SEARCH(" ?",RIGHT(A2,2))),
    A2,LEFT(A2,LEN(A2)-2)))),IF(ISERROR(SEARCH(" ?",RIGHT(A2,2))),A2,
    LEFT(A2,LEN(A2)-2)),REPLACE(IF(ISERROR(SEARCH(" ?",RIGHT(A2,2))),
    A2,LEFT(A2,LEN(A2)-2)),SEARCH(" ? &",IF(ISERROR(SEARCH(" ?",
    RIGHT(A2,2))),A2,LEFT(A2,LEN(A2)-2))),3," "))

    It returns the following:

    Frank & Debbie
    Marshall & Teresa
    Timothy
    Jeffrey & Eileen
    Pamela
    James & Rachel
    Brooke
    Myung
    Martin & Susan
    Kathleen


    If there is a concern for extra spaces creeping in, then substitute TRIM(A2)
    for the A2's:

    =IF(ISERROR(SEARCH(" ? &",IF(ISERROR(SEARCH(" ?",RIGHT(TRIM(A2),2))),
    TRIM(A2),LEFT(TRIM(A2),LEN(TRIM(A2))-2)))),IF(ISERROR(SEARCH(
    " ?",RIGHT(TRIM(A2),2))),TRIM(A2),LEFT(TRIM(A2),LEN(TRIM(A2))-2)),
    REPLACE(IF(ISERROR(SEARCH(" ?",RIGHT(TRIM(A2),2))),TRIM(A2),LEFT(
    TRIM(A2),LEN(TRIM(A2))-2)),SEARCH(" ? &",IF(ISERROR(SEARCH(" ?",RIGHT(
    TRIM(A2),2))),TRIM(A2),LEFT(TRIM(A2),LEN(TRIM(A2))-2))),3," "))


    --ron

  5. #5
    Max
    Guest

    Re: Remove middle initial from "first name middle initial"

    Superb one, Ron !

    My flawed attempt was due to an oversimplified interp <g>
    on the spec's part of preserving the data if there's an "&" inside ..
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----



  6. #6
    Max
    Guest

    Re: Remove middle initial from "first name middle initial"

    ugh .. pl trash all earlier suggestions here
    (mis-read the specs)

    See Ron's offering ..
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----



  7. #7
    Ron Rosenfeld
    Guest

    Re: Remove middle initial from "first name middle initial"

    On Fri, 24 Jun 2005 10:19:13 +0800, "Max" <[email protected]> wrote:

    >Superb one, Ron !
    >
    >My flawed attempt was due to an oversimplified interp <g>
    >on the spec's part of preserving the data if there's an "&" inside ..


    I tried yours first, and when it didn't return what I thought the OP wanted, I
    decided to work on it.

    But I've posted many non-solutions due to misinterpretations of the
    specifications, also <sigh>


    --ron

  8. #8
    Justin F.
    Guest

    Re: Remove middle initial from "first name middle initial"

    Ron, This is awesome. Thank you so much for your help! Max, thanks also for
    the attempt. Its very much appreciated.

    Justin F.

    "Ron Rosenfeld" wrote:

    > On Fri, 24 Jun 2005 10:19:13 +0800, "Max" <[email protected]> wrote:
    >
    > >Superb one, Ron !
    > >
    > >My flawed attempt was due to an oversimplified interp <g>
    > >on the spec's part of preserving the data if there's an "&" inside ..

    >
    > I tried yours first, and when it didn't return what I thought the OP wanted, I
    > decided to work on it.
    >
    > But I've posted many non-solutions due to misinterpretations of the
    > specifications, also <sigh>
    >
    >
    > --ron
    >


  9. #9
    Ron Rosenfeld
    Guest

    Re: Remove middle initial from "first name middle initial"

    On Fri, 24 Jun 2005 10:25:05 -0700, Justin F.
    <[email protected]> wrote:

    >Ron, This is awesome. Thank you so much for your help! Max, thanks also for
    >the attempt. Its very much appreciated.


    You're welcome. Thanks for the feedback. Post back if you run into problems
    with it.


    --ron

  10. #10
    Max
    Guest

    Re: Remove middle initial from "first name middle initial"

    You're welcome, Justin !
    Thanks for the feedback ..
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----
    "Justin F." <[email protected]> wrote in message
    news:[email protected]...
    > Ron, This is awesome. Thank you so much for your help!
    > Max, thanks also for the attempt. Its very much appreciated.
    >
    > Justin F.




  11. #11
    Registered User
    Join Date
    06-28-2005
    Posts
    6

    Along the same line...

    I need a similar effect to the one above, but my list contains names in the form LASTNAME, FIRSTNAME MI. and I want to remove the middle initials. Not all of them have a middle initial in them. Thanks!

  12. #12
    Ron Rosenfeld
    Guest

    Re: Remove middle initial from "first name middle initial"

    On Tue, 28 Jun 2005 15:25:51 -0500, JFALK
    <[email protected]> wrote:

    >
    >I need a similar effect to the one above, but my list contains names in
    >the form LASTNAME, FIRSTNAME MI. and I want to remove the middle
    >initials. Not all of them have a middle initial in them. Thanks!



    Try this:

    =IF((LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ","")))<2,
    TRIM(A1),LEFT(TRIM(A1),FIND(CHAR(1),SUBSTITUTE(
    TRIM(A1)," ",CHAR(1),2))-1))


    --ron

  13. #13
    Registered User
    Join Date
    06-28-2005
    Posts
    6
    Quote Originally Posted by Ron Rosenfeld
    On Tue, 28 Jun 2005 15:25:51 -0500, JFALK
    <[email protected]> wrote:

    >
    >I need a similar effect to the one above, but my list contains names in
    >the form LASTNAME, FIRSTNAME MI. and I want to remove the middle
    >initials. Not all of them have a middle initial in them. Thanks!



    Try this:

    =IF((LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ","")))<2,
    TRIM(A1),LEFT(TRIM(A1),FIND(CHAR(1),SUBSTITUTE(
    TRIM(A1)," ",CHAR(1),2))-1))


    --ron

    THANK YOU! It worked perfectly!

  14. #14
    Ron Rosenfeld
    Guest

    Re: Remove middle initial from "first name middle initial"

    On Wed, 29 Jun 2005 08:57:46 -0500, JFALK
    <[email protected]> wrote:

    >


    >
    >THANK YOU! It worked perfectly!


    You're welcome. Glad to help.


    --ron

  15. #15
    dave glynn
    Guest

    RE:How do I convert first names to initals

    I have a list of names that includes at leats one first name.

    I need to reduce the first name to its initial so that my list which is


    William Smith

    Joseph Bloggs
    etc


    becomes

    W Smith

    J Bloggs

    etc...


    Thanks


    Dave Glynn

  16. #16
    Dave Peterson
    Guest

    Re: How do I convert first names to initals

    Maybe you could use a formula:

    =LEFT(A1,1)&MID(A1,SEARCH(" ",A1),255)



    dave glynn wrote:
    >
    > I have a list of names that includes at leats one first name.
    >
    > I need to reduce the first name to its initial so that my list which is
    >
    > William Smith
    >
    > Joseph Bloggs
    > etc
    >
    > becomes
    >
    > W Smith
    >
    > J Bloggs
    >
    > etc...
    >
    > Thanks
    >
    > Dave Glynn


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1