+ Reply to Thread
Results 1 to 5 of 5

Looking for help trimming data from a cell...

Hybrid View

  1. #1
    Registered User
    Join Date
    12-01-2006
    Posts
    23

    Looking for help trimming data from a cell...

    I have a list of names. Some have middle initials, some don't. I don't want any of them to have a middle initial, so I'm trying to trim just the middle initial out.

    The names look like this:
    Doe, John
    Doe, Jane
    Doe, Jane A.

    I'd like any name that has a middle initial to lose it.

    Any ideas?

  2. #2
    Forum Contributor
    Join Date
    03-15-2005
    Location
    North Carolina
    MS-Off Ver
    2003 & 2007
    Posts
    180
    You could create a helper column and use:

    =IF(RIGHT(A1,1)=".",LEFT(A1,LEN(A1)-3),A1)

    This works if you always have a . after the middle initial. If you don't always have that, there are other ways.

    HTH
    jtp

  3. #3
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211
    Quote Originally Posted by SBells
    I have a list of names. Some have middle initials, some don't. I don't want any of them to have a middle initial, so I'm trying to trim just the middle initial out.

    The names look like this:
    Doe, John
    Doe, Jane
    Doe, Jane A.

    I'd like any name that has a middle initial to lose it.

    Any ideas?
    =IF(ISERROR(LEFT(A1,FIND(" ",A1,FIND(" ",A1,1)+1))),A1,LEFT(A1,FIND(" ",A1,FIND(" ",A1,1)+1)-1))

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,704
    Perhaps

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

    which will also return a blank if A1 is blank

    or to adapt jtp's suggestion

    =LEFT(A1,LEN(A1)-(RIGHT(A1)=".")*3)

  5. #5
    Registered User
    Join Date
    12-01-2006
    Posts
    23
    Thanks for the help! I ended up using a helper column to get it complete, but I'll try these out next time.

+ 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