+ Reply to Thread
Results 1 to 79 of 79

Stripping Middle Initial from a Name

  1. #1
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Hi, Dave.

    Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    where X=middle initial. I mistakenly put a comma after Firstname. I tried
    modifying your formula, but it doesn't seem to be working for me. =) Can
    you help?

    Thanks!

    "Dave Peterson" wrote:

    > I'd use a helper cell:
    >
    > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    >
    > And drag down the column.
    >
    > mira wrote:
    > >
    > > Hello.
    > >
    > > I need a function that strips the Middle Initial of a name. The names on my
    > > spreadsheet are all mixed up with names that have middle initials, and some
    > > that done. For example, I would like to strip the middle initial, 'X' off
    > > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > > Initial
    > >
    > > Hope that makes sense.
    > >
    > > Thanks!

    >
    > --
    >
    > Dave Peterson
    >


  2. #2
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Flippancy aside Harlan, you pay me too much credit, assuming I was "lazy" to
    omit the check for the coma preceding the space.

    Honestly, I just didn't think about it.

    As always, I become slightly more enlightened by each of our interchanges,
    be they confrontational OR flippant:

    =IF(AND(CODE(RIGHT(A1,2))=32,CODE(RIGHT(A1,3))<>44),LEFT(A1,LEN(A1)-2),A1)
    --

    Regards,

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


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by

    on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.



  3. #3
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Bob, the formula below stripped off everything after the last name. Help!

    "Bob Phillips" wrote:

    > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > ",A1)+1)-1),A1)
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "mira" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi, Dave.
    > >
    > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > tried
    > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > you help?
    > >
    > > Thanks!
    > >
    > > "Dave Peterson" wrote:
    > >
    > > > I'd use a helper cell:
    > > >
    > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > >
    > > > And drag down the column.
    > > >
    > > > mira wrote:
    > > > >
    > > > > Hello.
    > > > >
    > > > > I need a function that strips the Middle Initial of a name. The names

    > on my
    > > > > spreadsheet are all mixed up with names that have middle initials, and

    > some
    > > > > that done. For example, I would like to strip the middle initial, 'X'

    > off
    > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > X=Middle
    > > > > Initial
    > > > >
    > > > > Hope that makes sense.
    > > > >
    > > > > Thanks!
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >

    >
    >
    >


  4. #4
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    mira wrote...
    >Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    >where X=middle initial. I mistakenly put a comma after Firstname. I tried
    >modifying your formula, but it doesn't seem to be working for me. =) Can
    >you help?

    ....

    If the middle initial would always be the last nonspace character and
    would always be preceded by a space, you could try

    =IF(AND(LEFT(RIGHT(TRIM(x),3),1)<>",",LEFT(RIGHT(TRIM(x),2),1)=" "),
    LEFT(TRIM(x),LEN(TRIM(x))-2),TRIM(x))

    The TRIM calls guard against leading, trailing and multiple sequential
    spaces in x. If there were no extra spaces and x were a cell reference,
    you could use

    =IF(COUNTIF(x,"*,?* ?"),LEFT(H1,LEN(H1)-2),H1)


  5. #5
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    ",A1)+1)-1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >




  6. #6
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.


  7. #7
    Duke Carey
    Guest

    Re: Stripping Middle Initial from a Name

    maybe

    =IF(MID(A1,LEN(A1)-1,1)=" ",LEFT(A1,LEN(A1)-2),A1)

    "mira" wrote:

    > Bob, the formula below stripped off everything after the last name. Help!
    >
    > "Bob Phillips" wrote:
    >
    > > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > > ",A1)+1)-1),A1)
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "mira" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi, Dave.
    > > >
    > > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > > tried
    > > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > > you help?
    > > >
    > > > Thanks!
    > > >
    > > > "Dave Peterson" wrote:
    > > >
    > > > > I'd use a helper cell:
    > > > >
    > > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > > >
    > > > > And drag down the column.
    > > > >
    > > > > mira wrote:
    > > > > >
    > > > > > Hello.
    > > > > >
    > > > > > I need a function that strips the Middle Initial of a name. The names

    > > on my
    > > > > > spreadsheet are all mixed up with names that have middle initials, and

    > > some
    > > > > > that done. For example, I would like to strip the middle initial, 'X'

    > > off
    > > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > > X=Middle
    > > > > > Initial
    > > > > >
    > > > > > Hope that makes sense.
    > > > > >
    > > > > > Thanks!
    > > > >
    > > > > --
    > > > >
    > > > > Dave Peterson
    > > > >

    > >
    > >
    > >


  8. #8
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Gosh, there's a name from the past!

    Bob


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > RagDyer wrote...
    > >See if this works for you:
    > >
    > >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    > ...
    >
    > This could screw up some Asian names, e.g.,
    >
    > Thant, U
    >




  9. #9
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Yes, I realize that Harlan.

    There are so many, that it's difficult to count them all, as they ride by on
    their zebras.<g>

    --

    Regards,

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

    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U



  10. #10
    Dave Peterson
    Guest

    Re: Stripping Middle Initial from a Name

    I'd use a helper cell:

    =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)

    And drag down the column.

    mira wrote:
    >
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on my
    > spreadsheet are all mixed up with names that have middle initials, and some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!


    --

    Dave Peterson

  11. #11
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Mira,

    Try this

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1,",",""))=2,LEFT(A1,FIND(",",A1,FIND(",",A1)+1)
    -1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on

    my
    > spreadsheet are all mixed up with names that have middle initials, and

    some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!




  12. #12
    RagDyer
    Guest

    Re: Stripping Middle Initial from a Name

    See if this works for you:

    =IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    --
    HTH,

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



    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >



  13. #13
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U


  14. #14
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U


  15. #15
    Duke Carey
    Guest

    Re: Stripping Middle Initial from a Name

    maybe

    =IF(MID(A1,LEN(A1)-1,1)=" ",LEFT(A1,LEN(A1)-2),A1)

    "mira" wrote:

    > Bob, the formula below stripped off everything after the last name. Help!
    >
    > "Bob Phillips" wrote:
    >
    > > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > > ",A1)+1)-1),A1)
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "mira" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi, Dave.
    > > >
    > > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > > tried
    > > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > > you help?
    > > >
    > > > Thanks!
    > > >
    > > > "Dave Peterson" wrote:
    > > >
    > > > > I'd use a helper cell:
    > > > >
    > > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > > >
    > > > > And drag down the column.
    > > > >
    > > > > mira wrote:
    > > > > >
    > > > > > Hello.
    > > > > >
    > > > > > I need a function that strips the Middle Initial of a name. The names

    > > on my
    > > > > > spreadsheet are all mixed up with names that have middle initials, and

    > > some
    > > > > > that done. For example, I would like to strip the middle initial, 'X'

    > > off
    > > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > > X=Middle
    > > > > > Initial
    > > > > >
    > > > > > Hope that makes sense.
    > > > > >
    > > > > > Thanks!
    > > > >
    > > > > --
    > > > >
    > > > > Dave Peterson
    > > > >

    > >
    > >
    > >


  16. #16
    RagDyer
    Guest

    Re: Stripping Middle Initial from a Name

    See if this works for you:

    =IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    --
    HTH,

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



    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >



  17. #17
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    mira wrote...
    >Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    >where X=middle initial. I mistakenly put a comma after Firstname. I tried
    >modifying your formula, but it doesn't seem to be working for me. =) Can
    >you help?

    ....

    If the middle initial would always be the last nonspace character and
    would always be preceded by a space, you could try

    =IF(AND(LEFT(RIGHT(TRIM(x),3),1)<>",",LEFT(RIGHT(TRIM(x),2),1)=" "),
    LEFT(TRIM(x),LEN(TRIM(x))-2),TRIM(x))

    The TRIM calls guard against leading, trailing and multiple sequential
    spaces in x. If there were no extra spaces and x were a cell reference,
    you could use

    =IF(COUNTIF(x,"*,?* ?"),LEFT(H1,LEN(H1)-2),H1)


  18. #18
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Bob, the formula below stripped off everything after the last name. Help!

    "Bob Phillips" wrote:

    > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > ",A1)+1)-1),A1)
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "mira" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi, Dave.
    > >
    > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > tried
    > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > you help?
    > >
    > > Thanks!
    > >
    > > "Dave Peterson" wrote:
    > >
    > > > I'd use a helper cell:
    > > >
    > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > >
    > > > And drag down the column.
    > > >
    > > > mira wrote:
    > > > >
    > > > > Hello.
    > > > >
    > > > > I need a function that strips the Middle Initial of a name. The names

    > on my
    > > > > spreadsheet are all mixed up with names that have middle initials, and

    > some
    > > > > that done. For example, I would like to strip the middle initial, 'X'

    > off
    > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > X=Middle
    > > > > Initial
    > > > >
    > > > > Hope that makes sense.
    > > > >
    > > > > Thanks!
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >

    >
    >
    >


  19. #19
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    ",A1)+1)-1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >




  20. #20
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Flippancy aside Harlan, you pay me too much credit, assuming I was "lazy" to
    omit the check for the coma preceding the space.

    Honestly, I just didn't think about it.

    As always, I become slightly more enlightened by each of our interchanges,
    be they confrontational OR flippant:

    =IF(AND(CODE(RIGHT(A1,2))=32,CODE(RIGHT(A1,3))<>44),LEFT(A1,LEN(A1)-2),A1)
    --

    Regards,

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


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by

    on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.



  21. #21
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Hi, Dave.

    Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    where X=middle initial. I mistakenly put a comma after Firstname. I tried
    modifying your formula, but it doesn't seem to be working for me. =) Can
    you help?

    Thanks!

    "Dave Peterson" wrote:

    > I'd use a helper cell:
    >
    > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    >
    > And drag down the column.
    >
    > mira wrote:
    > >
    > > Hello.
    > >
    > > I need a function that strips the Middle Initial of a name. The names on my
    > > spreadsheet are all mixed up with names that have middle initials, and some
    > > that done. For example, I would like to strip the middle initial, 'X' off
    > > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > > Initial
    > >
    > > Hope that makes sense.
    > >
    > > Thanks!

    >
    > --
    >
    > Dave Peterson
    >


  22. #22
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Yes, I realize that Harlan.

    There are so many, that it's difficult to count them all, as they ride by on
    their zebras.<g>

    --

    Regards,

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

    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U



  23. #23
    Dave Peterson
    Guest

    Re: Stripping Middle Initial from a Name

    I'd use a helper cell:

    =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)

    And drag down the column.

    mira wrote:
    >
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on my
    > spreadsheet are all mixed up with names that have middle initials, and some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!


    --

    Dave Peterson

  24. #24
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Gosh, there's a name from the past!

    Bob


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > RagDyer wrote...
    > >See if this works for you:
    > >
    > >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    > ...
    >
    > This could screw up some Asian names, e.g.,
    >
    > Thant, U
    >




  25. #25
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Mira,

    Try this

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1,",",""))=2,LEFT(A1,FIND(",",A1,FIND(",",A1)+1)
    -1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on

    my
    > spreadsheet are all mixed up with names that have middle initials, and

    some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!




  26. #26
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.


  27. #27
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    ",A1)+1)-1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >




  28. #28
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Mira,

    Try this

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1,",",""))=2,LEFT(A1,FIND(",",A1,FIND(",",A1)+1)
    -1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on

    my
    > spreadsheet are all mixed up with names that have middle initials, and

    some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!




  29. #29
    Dave Peterson
    Guest

    Re: Stripping Middle Initial from a Name

    I'd use a helper cell:

    =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)

    And drag down the column.

    mira wrote:
    >
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on my
    > spreadsheet are all mixed up with names that have middle initials, and some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!


    --

    Dave Peterson

  30. #30
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Flippancy aside Harlan, you pay me too much credit, assuming I was "lazy" to
    omit the check for the coma preceding the space.

    Honestly, I just didn't think about it.

    As always, I become slightly more enlightened by each of our interchanges,
    be they confrontational OR flippant:

    =IF(AND(CODE(RIGHT(A1,2))=32,CODE(RIGHT(A1,3))<>44),LEFT(A1,LEN(A1)-2),A1)
    --

    Regards,

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


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by

    on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.



  31. #31
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Bob, the formula below stripped off everything after the last name. Help!

    "Bob Phillips" wrote:

    > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > ",A1)+1)-1),A1)
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "mira" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi, Dave.
    > >
    > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > tried
    > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > you help?
    > >
    > > Thanks!
    > >
    > > "Dave Peterson" wrote:
    > >
    > > > I'd use a helper cell:
    > > >
    > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > >
    > > > And drag down the column.
    > > >
    > > > mira wrote:
    > > > >
    > > > > Hello.
    > > > >
    > > > > I need a function that strips the Middle Initial of a name. The names

    > on my
    > > > > spreadsheet are all mixed up with names that have middle initials, and

    > some
    > > > > that done. For example, I would like to strip the middle initial, 'X'

    > off
    > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > X=Middle
    > > > > Initial
    > > > >
    > > > > Hope that makes sense.
    > > > >
    > > > > Thanks!
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >

    >
    >
    >


  32. #32
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.


  33. #33
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Gosh, there's a name from the past!

    Bob


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > RagDyer wrote...
    > >See if this works for you:
    > >
    > >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    > ...
    >
    > This could screw up some Asian names, e.g.,
    >
    > Thant, U
    >




  34. #34
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Yes, I realize that Harlan.

    There are so many, that it's difficult to count them all, as they ride by on
    their zebras.<g>

    --

    Regards,

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

    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U



  35. #35
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U


  36. #36
    RagDyer
    Guest

    Re: Stripping Middle Initial from a Name

    See if this works for you:

    =IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    --
    HTH,

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



    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >



  37. #37
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    mira wrote...
    >Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    >where X=middle initial. I mistakenly put a comma after Firstname. I tried
    >modifying your formula, but it doesn't seem to be working for me. =) Can
    >you help?

    ....

    If the middle initial would always be the last nonspace character and
    would always be preceded by a space, you could try

    =IF(AND(LEFT(RIGHT(TRIM(x),3),1)<>",",LEFT(RIGHT(TRIM(x),2),1)=" "),
    LEFT(TRIM(x),LEN(TRIM(x))-2),TRIM(x))

    The TRIM calls guard against leading, trailing and multiple sequential
    spaces in x. If there were no extra spaces and x were a cell reference,
    you could use

    =IF(COUNTIF(x,"*,?* ?"),LEFT(H1,LEN(H1)-2),H1)


  38. #38
    Duke Carey
    Guest

    Re: Stripping Middle Initial from a Name

    maybe

    =IF(MID(A1,LEN(A1)-1,1)=" ",LEFT(A1,LEN(A1)-2),A1)

    "mira" wrote:

    > Bob, the formula below stripped off everything after the last name. Help!
    >
    > "Bob Phillips" wrote:
    >
    > > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > > ",A1)+1)-1),A1)
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "mira" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi, Dave.
    > > >
    > > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > > tried
    > > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > > you help?
    > > >
    > > > Thanks!
    > > >
    > > > "Dave Peterson" wrote:
    > > >
    > > > > I'd use a helper cell:
    > > > >
    > > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > > >
    > > > > And drag down the column.
    > > > >
    > > > > mira wrote:
    > > > > >
    > > > > > Hello.
    > > > > >
    > > > > > I need a function that strips the Middle Initial of a name. The names

    > > on my
    > > > > > spreadsheet are all mixed up with names that have middle initials, and

    > > some
    > > > > > that done. For example, I would like to strip the middle initial, 'X'

    > > off
    > > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > > X=Middle
    > > > > > Initial
    > > > > >
    > > > > > Hope that makes sense.
    > > > > >
    > > > > > Thanks!
    > > > >
    > > > > --
    > > > >
    > > > > Dave Peterson
    > > > >

    > >
    > >
    > >


  39. #39
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Hi, Dave.

    Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    where X=middle initial. I mistakenly put a comma after Firstname. I tried
    modifying your formula, but it doesn't seem to be working for me. =) Can
    you help?

    Thanks!

    "Dave Peterson" wrote:

    > I'd use a helper cell:
    >
    > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    >
    > And drag down the column.
    >
    > mira wrote:
    > >
    > > Hello.
    > >
    > > I need a function that strips the Middle Initial of a name. The names on my
    > > spreadsheet are all mixed up with names that have middle initials, and some
    > > that done. For example, I would like to strip the middle initial, 'X' off
    > > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > > Initial
    > >
    > > Hope that makes sense.
    > >
    > > Thanks!

    >
    > --
    >
    > Dave Peterson
    >


  40. #40
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Mira,

    Try this

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1,",",""))=2,LEFT(A1,FIND(",",A1,FIND(",",A1)+1)
    -1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on

    my
    > spreadsheet are all mixed up with names that have middle initials, and

    some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!




  41. #41
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U


  42. #42
    RagDyer
    Guest

    Re: Stripping Middle Initial from a Name

    See if this works for you:

    =IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    --
    HTH,

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



    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >



  43. #43
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Yes, I realize that Harlan.

    There are so many, that it's difficult to count them all, as they ride by on
    their zebras.<g>

    --

    Regards,

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

    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U



  44. #44
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Gosh, there's a name from the past!

    Bob


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > RagDyer wrote...
    > >See if this works for you:
    > >
    > >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    > ...
    >
    > This could screw up some Asian names, e.g.,
    >
    > Thant, U
    >




  45. #45
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.


  46. #46
    Duke Carey
    Guest

    Re: Stripping Middle Initial from a Name

    maybe

    =IF(MID(A1,LEN(A1)-1,1)=" ",LEFT(A1,LEN(A1)-2),A1)

    "mira" wrote:

    > Bob, the formula below stripped off everything after the last name. Help!
    >
    > "Bob Phillips" wrote:
    >
    > > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > > ",A1)+1)-1),A1)
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "mira" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi, Dave.
    > > >
    > > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > > tried
    > > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > > you help?
    > > >
    > > > Thanks!
    > > >
    > > > "Dave Peterson" wrote:
    > > >
    > > > > I'd use a helper cell:
    > > > >
    > > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > > >
    > > > > And drag down the column.
    > > > >
    > > > > mira wrote:
    > > > > >
    > > > > > Hello.
    > > > > >
    > > > > > I need a function that strips the Middle Initial of a name. The names

    > > on my
    > > > > > spreadsheet are all mixed up with names that have middle initials, and

    > > some
    > > > > > that done. For example, I would like to strip the middle initial, 'X'

    > > off
    > > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > > X=Middle
    > > > > > Initial
    > > > > >
    > > > > > Hope that makes sense.
    > > > > >
    > > > > > Thanks!
    > > > >
    > > > > --
    > > > >
    > > > > Dave Peterson
    > > > >

    > >
    > >
    > >


  47. #47
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Flippancy aside Harlan, you pay me too much credit, assuming I was "lazy" to
    omit the check for the coma preceding the space.

    Honestly, I just didn't think about it.

    As always, I become slightly more enlightened by each of our interchanges,
    be they confrontational OR flippant:

    =IF(AND(CODE(RIGHT(A1,2))=32,CODE(RIGHT(A1,3))<>44),LEFT(A1,LEN(A1)-2),A1)
    --

    Regards,

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


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by

    on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.



  48. #48
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    mira wrote...
    >Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    >where X=middle initial. I mistakenly put a comma after Firstname. I tried
    >modifying your formula, but it doesn't seem to be working for me. =) Can
    >you help?

    ....

    If the middle initial would always be the last nonspace character and
    would always be preceded by a space, you could try

    =IF(AND(LEFT(RIGHT(TRIM(x),3),1)<>",",LEFT(RIGHT(TRIM(x),2),1)=" "),
    LEFT(TRIM(x),LEN(TRIM(x))-2),TRIM(x))

    The TRIM calls guard against leading, trailing and multiple sequential
    spaces in x. If there were no extra spaces and x were a cell reference,
    you could use

    =IF(COUNTIF(x,"*,?* ?"),LEFT(H1,LEN(H1)-2),H1)


  49. #49
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Bob, the formula below stripped off everything after the last name. Help!

    "Bob Phillips" wrote:

    > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > ",A1)+1)-1),A1)
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "mira" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi, Dave.
    > >
    > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > tried
    > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > you help?
    > >
    > > Thanks!
    > >
    > > "Dave Peterson" wrote:
    > >
    > > > I'd use a helper cell:
    > > >
    > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > >
    > > > And drag down the column.
    > > >
    > > > mira wrote:
    > > > >
    > > > > Hello.
    > > > >
    > > > > I need a function that strips the Middle Initial of a name. The names

    > on my
    > > > > spreadsheet are all mixed up with names that have middle initials, and

    > some
    > > > > that done. For example, I would like to strip the middle initial, 'X'

    > off
    > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > X=Middle
    > > > > Initial
    > > > >
    > > > > Hope that makes sense.
    > > > >
    > > > > Thanks!
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >

    >
    >
    >


  50. #50
    Dave Peterson
    Guest

    Re: Stripping Middle Initial from a Name

    I'd use a helper cell:

    =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)

    And drag down the column.

    mira wrote:
    >
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on my
    > spreadsheet are all mixed up with names that have middle initials, and some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!


    --

    Dave Peterson

  51. #51
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    ",A1)+1)-1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >




  52. #52
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Hi, Dave.

    Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    where X=middle initial. I mistakenly put a comma after Firstname. I tried
    modifying your formula, but it doesn't seem to be working for me. =) Can
    you help?

    Thanks!

    "Dave Peterson" wrote:

    > I'd use a helper cell:
    >
    > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    >
    > And drag down the column.
    >
    > mira wrote:
    > >
    > > Hello.
    > >
    > > I need a function that strips the Middle Initial of a name. The names on my
    > > spreadsheet are all mixed up with names that have middle initials, and some
    > > that done. For example, I would like to strip the middle initial, 'X' off
    > > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > > Initial
    > >
    > > Hope that makes sense.
    > >
    > > Thanks!

    >
    > --
    >
    > Dave Peterson
    >


  53. #53
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Gosh, there's a name from the past!

    Bob


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > RagDyer wrote...
    > >See if this works for you:
    > >
    > >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    > ...
    >
    > This could screw up some Asian names, e.g.,
    >
    > Thant, U
    >




  54. #54
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.


  55. #55
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Yes, I realize that Harlan.

    There are so many, that it's difficult to count them all, as they ride by on
    their zebras.<g>

    --

    Regards,

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

    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U



  56. #56
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Flippancy aside Harlan, you pay me too much credit, assuming I was "lazy" to
    omit the check for the coma preceding the space.

    Honestly, I just didn't think about it.

    As always, I become slightly more enlightened by each of our interchanges,
    be they confrontational OR flippant:

    =IF(AND(CODE(RIGHT(A1,2))=32,CODE(RIGHT(A1,3))<>44),LEFT(A1,LEN(A1)-2),A1)
    --

    Regards,

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


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by

    on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.



  57. #57
    Duke Carey
    Guest

    Re: Stripping Middle Initial from a Name

    maybe

    =IF(MID(A1,LEN(A1)-1,1)=" ",LEFT(A1,LEN(A1)-2),A1)

    "mira" wrote:

    > Bob, the formula below stripped off everything after the last name. Help!
    >
    > "Bob Phillips" wrote:
    >
    > > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > > ",A1)+1)-1),A1)
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "mira" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi, Dave.
    > > >
    > > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > > tried
    > > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > > you help?
    > > >
    > > > Thanks!
    > > >
    > > > "Dave Peterson" wrote:
    > > >
    > > > > I'd use a helper cell:
    > > > >
    > > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > > >
    > > > > And drag down the column.
    > > > >
    > > > > mira wrote:
    > > > > >
    > > > > > Hello.
    > > > > >
    > > > > > I need a function that strips the Middle Initial of a name. The names

    > > on my
    > > > > > spreadsheet are all mixed up with names that have middle initials, and

    > > some
    > > > > > that done. For example, I would like to strip the middle initial, 'X'

    > > off
    > > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > > X=Middle
    > > > > > Initial
    > > > > >
    > > > > > Hope that makes sense.
    > > > > >
    > > > > > Thanks!
    > > > >
    > > > > --
    > > > >
    > > > > Dave Peterson
    > > > >

    > >
    > >
    > >


  58. #58
    RagDyer
    Guest

    Re: Stripping Middle Initial from a Name

    See if this works for you:

    =IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    --
    HTH,

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



    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >



  59. #59
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U


  60. #60
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    mira wrote...
    >Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    >where X=middle initial. I mistakenly put a comma after Firstname. I tried
    >modifying your formula, but it doesn't seem to be working for me. =) Can
    >you help?

    ....

    If the middle initial would always be the last nonspace character and
    would always be preceded by a space, you could try

    =IF(AND(LEFT(RIGHT(TRIM(x),3),1)<>",",LEFT(RIGHT(TRIM(x),2),1)=" "),
    LEFT(TRIM(x),LEN(TRIM(x))-2),TRIM(x))

    The TRIM calls guard against leading, trailing and multiple sequential
    spaces in x. If there were no extra spaces and x were a cell reference,
    you could use

    =IF(COUNTIF(x,"*,?* ?"),LEFT(H1,LEN(H1)-2),H1)


  61. #61
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Bob, the formula below stripped off everything after the last name. Help!

    "Bob Phillips" wrote:

    > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > ",A1)+1)-1),A1)
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "mira" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi, Dave.
    > >
    > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > tried
    > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > you help?
    > >
    > > Thanks!
    > >
    > > "Dave Peterson" wrote:
    > >
    > > > I'd use a helper cell:
    > > >
    > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > >
    > > > And drag down the column.
    > > >
    > > > mira wrote:
    > > > >
    > > > > Hello.
    > > > >
    > > > > I need a function that strips the Middle Initial of a name. The names

    > on my
    > > > > spreadsheet are all mixed up with names that have middle initials, and

    > some
    > > > > that done. For example, I would like to strip the middle initial, 'X'

    > off
    > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > X=Middle
    > > > > Initial
    > > > >
    > > > > Hope that makes sense.
    > > > >
    > > > > Thanks!
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >

    >
    >
    >


  62. #62
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    ",A1)+1)-1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >




  63. #63
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Hi, Dave.

    Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    where X=middle initial. I mistakenly put a comma after Firstname. I tried
    modifying your formula, but it doesn't seem to be working for me. =) Can
    you help?

    Thanks!

    "Dave Peterson" wrote:

    > I'd use a helper cell:
    >
    > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    >
    > And drag down the column.
    >
    > mira wrote:
    > >
    > > Hello.
    > >
    > > I need a function that strips the Middle Initial of a name. The names on my
    > > spreadsheet are all mixed up with names that have middle initials, and some
    > > that done. For example, I would like to strip the middle initial, 'X' off
    > > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > > Initial
    > >
    > > Hope that makes sense.
    > >
    > > Thanks!

    >
    > --
    >
    > Dave Peterson
    >


  64. #64
    Dave Peterson
    Guest

    Re: Stripping Middle Initial from a Name

    I'd use a helper cell:

    =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)

    And drag down the column.

    mira wrote:
    >
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on my
    > spreadsheet are all mixed up with names that have middle initials, and some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!


    --

    Dave Peterson

  65. #65
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Mira,

    Try this

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1,",",""))=2,LEFT(A1,FIND(",",A1,FIND(",",A1)+1)
    -1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on

    my
    > spreadsheet are all mixed up with names that have middle initials, and

    some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!




  66. #66
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Mira,

    Try this

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1,",",""))=2,LEFT(A1,FIND(",",A1,FIND(",",A1)+1)
    -1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on

    my
    > spreadsheet are all mixed up with names that have middle initials, and

    some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!




  67. #67
    Dave Peterson
    Guest

    Re: Stripping Middle Initial from a Name

    I'd use a helper cell:

    =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)

    And drag down the column.

    mira wrote:
    >
    > Hello.
    >
    > I need a function that strips the Middle Initial of a name. The names on my
    > spreadsheet are all mixed up with names that have middle initials, and some
    > that done. For example, I would like to strip the middle initial, 'X' off
    > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > Initial
    >
    > Hope that makes sense.
    >
    > Thanks!


    --

    Dave Peterson

  68. #68
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Hi, Dave.

    Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    where X=middle initial. I mistakenly put a comma after Firstname. I tried
    modifying your formula, but it doesn't seem to be working for me. =) Can
    you help?

    Thanks!

    "Dave Peterson" wrote:

    > I'd use a helper cell:
    >
    > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    >
    > And drag down the column.
    >
    > mira wrote:
    > >
    > > Hello.
    > >
    > > I need a function that strips the Middle Initial of a name. The names on my
    > > spreadsheet are all mixed up with names that have middle initials, and some
    > > that done. For example, I would like to strip the middle initial, 'X' off
    > > this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    > > Initial
    > >
    > > Hope that makes sense.
    > >
    > > Thanks!

    >
    > --
    >
    > Dave Peterson
    >


  69. #69
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    ",A1)+1)-1),A1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >




  70. #70
    mira
    Guest

    Re: Stripping Middle Initial from a Name

    Bob, the formula below stripped off everything after the last name. Help!

    "Bob Phillips" wrote:

    > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > ",A1)+1)-1),A1)
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "mira" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi, Dave.
    > >
    > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > tried
    > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > you help?
    > >
    > > Thanks!
    > >
    > > "Dave Peterson" wrote:
    > >
    > > > I'd use a helper cell:
    > > >
    > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > >
    > > > And drag down the column.
    > > >
    > > > mira wrote:
    > > > >
    > > > > Hello.
    > > > >
    > > > > I need a function that strips the Middle Initial of a name. The names

    > on my
    > > > > spreadsheet are all mixed up with names that have middle initials, and

    > some
    > > > > that done. For example, I would like to strip the middle initial, 'X'

    > off
    > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > X=Middle
    > > > > Initial
    > > > >
    > > > > Hope that makes sense.
    > > > >
    > > > > Thanks!
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >

    >
    >
    >


  71. #71
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    mira wrote...
    >Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    >where X=middle initial. I mistakenly put a comma after Firstname. I tried
    >modifying your formula, but it doesn't seem to be working for me. =) Can
    >you help?

    ....

    If the middle initial would always be the last nonspace character and
    would always be preceded by a space, you could try

    =IF(AND(LEFT(RIGHT(TRIM(x),3),1)<>",",LEFT(RIGHT(TRIM(x),2),1)=" "),
    LEFT(TRIM(x),LEN(TRIM(x))-2),TRIM(x))

    The TRIM calls guard against leading, trailing and multiple sequential
    spaces in x. If there were no extra spaces and x were a cell reference,
    you could use

    =IF(COUNTIF(x,"*,?* ?"),LEFT(H1,LEN(H1)-2),H1)


  72. #72
    Duke Carey
    Guest

    Re: Stripping Middle Initial from a Name

    maybe

    =IF(MID(A1,LEN(A1)-1,1)=" ",LEFT(A1,LEN(A1)-2),A1)

    "mira" wrote:

    > Bob, the formula below stripped off everything after the last name. Help!
    >
    > "Bob Phillips" wrote:
    >
    > > =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=2,LEFT(A1,FIND(" ",A1,FIND("
    > > ",A1)+1)-1),A1)
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "mira" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi, Dave.
    > > >
    > > > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > > > where X=middle initial. I mistakenly put a comma after Firstname. I

    > > tried
    > > > modifying your formula, but it doesn't seem to be working for me. =) Can
    > > > you help?
    > > >
    > > > Thanks!
    > > >
    > > > "Dave Peterson" wrote:
    > > >
    > > > > I'd use a helper cell:
    > > > >
    > > > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > > > >
    > > > > And drag down the column.
    > > > >
    > > > > mira wrote:
    > > > > >
    > > > > > Hello.
    > > > > >
    > > > > > I need a function that strips the Middle Initial of a name. The names

    > > on my
    > > > > > spreadsheet are all mixed up with names that have middle initials, and

    > > some
    > > > > > that done. For example, I would like to strip the middle initial, 'X'

    > > off
    > > > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    > > X=Middle
    > > > > > Initial
    > > > > >
    > > > > > Hope that makes sense.
    > > > > >
    > > > > > Thanks!
    > > > >
    > > > > --
    > > > >
    > > > > Dave Peterson
    > > > >

    > >
    > >
    > >


  73. #73
    RagDyer
    Guest

    Re: Stripping Middle Initial from a Name

    See if this works for you:

    =IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    --
    HTH,

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



    "mira" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Dave.
    >
    > Sorry! I made a mistake. The format of the name is Lastname, FirstName X
    > where X=middle initial. I mistakenly put a comma after Firstname. I

    tried
    > modifying your formula, but it doesn't seem to be working for me. =) Can
    > you help?
    >
    > Thanks!
    >
    > "Dave Peterson" wrote:
    >
    > > I'd use a helper cell:
    > >
    > > =IF(MID(A1,LEN(A1)-2,2)=", ",LEFT(A1,LEN(A1)-3),A1)
    > >
    > > And drag down the column.
    > >
    > > mira wrote:
    > > >
    > > > Hello.
    > > >
    > > > I need a function that strips the Middle Initial of a name. The names

    on my
    > > > spreadsheet are all mixed up with names that have middle initials, and

    some
    > > > that done. For example, I would like to strip the middle initial, 'X'

    off
    > > > this name, "Doe, John, X", where Doe=last name, John=First Name,

    X=Middle
    > > > Initial
    > > >
    > > > Hope that makes sense.
    > > >
    > > > Thanks!

    > >
    > > --
    > >
    > > Dave Peterson
    > >



  74. #74
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U


  75. #75
    mira
    Guest

    Stripping Middle Initial from a Name

    Hello.

    I need a function that strips the Middle Initial of a name. The names on my
    spreadsheet are all mixed up with names that have middle initials, and some
    that done. For example, I would like to strip the middle initial, 'X' off
    this name, "Doe, John, X", where Doe=last name, John=First Name, X=Middle
    Initial

    Hope that makes sense.

    Thanks!

  76. #76
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Yes, I realize that Harlan.

    There are so many, that it's difficult to count them all, as they ride by on
    their zebras.<g>

    --

    Regards,

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

    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyer wrote...
    >See if this works for you:
    >
    >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    ....

    This could screw up some Asian names, e.g.,

    Thant, U



  77. #77
    Bob Phillips
    Guest

    Re: Stripping Middle Initial from a Name

    Gosh, there's a name from the past!

    Bob


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > RagDyer wrote...
    > >See if this works for you:
    > >
    > >=IF(CODE(RIGHT(A1,2))=32,LEFT(A1,LEN(A1)-2),A1)

    > ...
    >
    > This could screw up some Asian names, e.g.,
    >
    > Thant, U
    >




  78. #78
    Harlan Grove
    Guest

    Re: Stripping Middle Initial from a Name

    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.


  79. #79
    RagDyeR
    Guest

    Re: Stripping Middle Initial from a Name

    Flippancy aside Harlan, you pay me too much credit, assuming I was "lazy" to
    omit the check for the coma preceding the space.

    Honestly, I just didn't think about it.

    As always, I become slightly more enlightened by each of our interchanges,
    be they confrontational OR flippant:

    =IF(AND(CODE(RIGHT(A1,2))=32,CODE(RIGHT(A1,3))<>44),LEFT(A1,LEN(A1)-2),A1)
    --

    Regards,

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


    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    RagDyeR wrote...
    >Yes, I realize that Harlan.
    >
    >There are so many, that it's difficult to count them all, as they ride by

    on
    >their zebras.<g>

    ....

    Flippancy aside, what distinguishes a middle name is that it's a final
    nonspace character preceded by a space character which in turn is *not*
    preceded by a comma. Don't get lazy and forget to check for a comma as
    3rd character from the end of the string.



+ 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