+ Reply to Thread
Results 1 to 17 of 17

remove middle initial + concatenate + lowercase

  1. #1
    Forum Contributor
    Join Date
    07-26-2016
    Location
    Philippines
    MS-Off Ver
    Google Sheets
    Posts
    124

    remove middle initial + concatenate + lowercase

    Hello! I a list of names (more than a thousand names) and I want to remove the middle initial if any the concatenate the firstname and lastname in lowercase, like the one shown below. I have this initial formula which partially does the work of removing the initial in certain names.

    Please Login or Register  to view this content.
    I know also that I have to use lower() to convert everything to lowercase.

    Can anyone please help me on this? Thank you!
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: remove middle initial + concatenate + lowercase

    With that example, how about
    =LOWER(B2&SUBSTITUTE(IFERROR(LEFT(A2,FIND(".",A2)-2),A2)," ",""))

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,463

    Re: remove middle initial + concatenate + lowercase

    On the off-chance the middle initial, when present, might not have an attached period at the end, give this formula a try...

    =LOWER(SUBSTITUTE(B2&IF(OR(RIGHT(A2)=".",MID(A2,LEN(A2)-1,1)=" "),LEFT(A2,LEN(A2)-2),A2)," ",""))
    Last edited by Rick Rothstein; 07-25-2020 at 10:59 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: remove middle initial + concatenate + lowercase

    With that example

    PHP Code: 
    =LOWER(SUBSTITUTE(LEFT(B2&A2,LEN(B2&A2)-2*(RIGHT(A2)="."))," ","")) 

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: remove middle initial + concatenate + lowercase

    Please try

    =LOWER(SUBSTITUTE(B2&LEFT(A2,FIND(".",A2&" .")-2)," ",))

  6. #6
    Forum Contributor
    Join Date
    07-26-2016
    Location
    Philippines
    MS-Off Ver
    Google Sheets
    Posts
    124

    Re: remove middle initial + concatenate + lowercase

    Quote Originally Posted by Fluff13 View Post
    With that example, how about
    =LOWER(B2&SUBSTITUTE(IFERROR(LEFT(A2,FIND(".",A2)-2),A2)," ",""))
    Thanks for the reply. Using the above code this is now the output. Everything is okay except the last name where there is no period for the middle initial.
    Attached Images Attached Images

  7. #7
    Forum Contributor
    Join Date
    07-26-2016
    Location
    Philippines
    MS-Off Ver
    Google Sheets
    Posts
    124

    Re: remove middle initial + concatenate + lowercase

    Quote Originally Posted by Rick Rothstein View Post
    On the off-chance the middle initial, when present, might not have an attached period at the end, give this formula a try...

    =LOWER(SUBSTITUTE(B2&IF(OR(RIGHT(A2)=".",MID(A2,LEN(A2)-1,1)=" "),LEFT(A2,LEN(A2)-2),A2)," ",""))
    Thank you for your reply. you're right sir that there is a chance that a period might be present so I went ahead and tried your code and it works but then I was also reminded that there are times that a person has two middle initials so I added names for that purpose and below is the result.
    Attached Images Attached Images

  8. #8
    Forum Contributor
    Join Date
    07-26-2016
    Location
    Philippines
    MS-Off Ver
    Google Sheets
    Posts
    124

    Re: remove middle initial + concatenate + lowercase

    Quote Originally Posted by Vraag en antwoord View Post
    With that example

    PHP Code: 
    =LOWER(SUBSTITUTE(LEFT(B2&A2,LEN(B2&A2)-2*(RIGHT(A2)="."))," ","")) 
    Thanks for the reply sir. Using your formula, I got the following output, but just like what I posted earlier, what if a person has two middle initials?
    Attached Images Attached Images

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: remove middle initial + concatenate + lowercase

    How do you want the result?

    1. John G. W. Doe -> ?

    2. John G W Doe -> ?

    3. John G.W Doe -> ?

  10. #10
    Forum Contributor
    Join Date
    07-26-2016
    Location
    Philippines
    MS-Off Ver
    Google Sheets
    Posts
    124

    Re: remove middle initial + concatenate + lowercase

    The result should be "doejohn"
    Last edited by AliGW; 07-26-2020 at 09:25 AM. Reason: Please don't quote unnecessarily!

  11. #11
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: remove middle initial + concatenate + lowercase

    Try this:

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    07-26-2016
    Location
    Philippines
    MS-Off Ver
    Google Sheets
    Posts
    124

    Re: remove middle initial + concatenate + lowercase

    PERFECT! Thank you very much sir!
    Last edited by AliGW; 07-26-2020 at 09:25 AM. Reason: Please don't quote unnecessarily!

  13. #13
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: remove middle initial + concatenate + lowercase

    You're welcome! Thanks for the reputation points.

  14. #14
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: remove middle initial + concatenate + lowercase

    Another one

    =LOWER(SUBSTITUTE(B2&LEFT(A2,SEARCH(" ? ",TRIM(SUBSTITUTE(A2,"."," "))&" "))," ",))
    Last edited by Bo_Ry; 07-26-2020 at 12:59 PM. Reason: Shorten

  15. #15
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,463

    Re: remove middle initial + concatenate + lowercase

    Quote Originally Posted by Bo_Ry View Post
    Another one

    =LOWER(SUBSTITUTE(B2&LEFT(A2,SEARCH(" ? ",TRIM(SUBSTITUTE(A2,"."," "))&" "))," ",))
    That did not seem to work against these names from Message #8... Katrine Andrea, Maria Annie Gale and Emely.

    If I am not mistaken, I believe this formula will work...

    =LOWER(SUBSTITUTE(B2&IFERROR(LEFT(A2,SEARCH(" ?.*?.",A2)-1),IFERROR(LEFT(A2,SEARCH(" ?.",A2&".")-1),A2))," ",""))
    Last edited by Rick Rothstein; 07-26-2020 at 04:24 PM.

  16. #16
    Forum Contributor
    Join Date
    07-26-2016
    Location
    Philippines
    MS-Off Ver
    Google Sheets
    Posts
    124

    Re: remove middle initial + concatenate + lowercase

    Quote Originally Posted by Rick Rothstein View Post
    That did not seem to work against these names from Message #8... Katrine Andrea, Maria Annie Gale and Emely.

    If I am not mistaken, I believe this formula will work...

    =LOWER(SUBSTITUTE(B2&IFERROR(LEFT(A2,SEARCH(" ?.*?.",A2)-1),IFERROR(LEFT(A2,SEARCH(" ?.",A2&".")-1),A2))," ",""))
    Thank you for this post. It works fine except in the it wont work against the name "John G W"

  17. #17
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,463

    Re: remove middle initial + concatenate + lowercase

    Quote Originally Posted by Simply_Me View Post
    Thank you for this post. It works fine except in the it wont work against the name "John G W"
    Okay, this shorter formula appears to handle all of your situations correctly...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formula to remove middle initial from first name in Excel
    By bjnockle in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-01-2020, 01:41 PM
  2. Replies: 1
    Last Post: 09-14-2016, 04:55 AM
  3. Replies: 3
    Last Post: 03-05-2015, 02:33 PM
  4. [SOLVED] Remove Middle Initial from end of string or jr, sr, etc.
    By mdnuts in forum Excel General
    Replies: 5
    Last Post: 02-20-2015, 12:29 PM
  5. Replies: 2
    Last Post: 06-20-2012, 04:41 PM
  6. Replies: 3
    Last Post: 03-09-2012, 03:19 PM
  7. Remove middle initial from "first name middle initial"
    By Justin F. in forum Excel General
    Replies: 15
    Last Post: 09-26-2005, 02:05 PM

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