+ Reply to Thread
Results 1 to 8 of 8

Formula to select the first name & second name

  1. #1
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    114

    Formula to select the first name & second name

    Hi;
    I am looking to write a the correct formula in order to select the first name of each actor from column (B) and put it under the column (D) under First name, and again to select the second name from column (B) and put it under the column (E) as Second name....etc.

    the attached file showing the name of actors, this is just only a sample of my file. However in column (B3) it showing the name of TOM HANKS therefore the first name will be under (D3 = TOM) and the second name will be under (E3=HANKS) and...etc, and what if i have more than 3 names like (first name, second name, Surname) what can be the formula condition?!!!

    BR
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Fomula to select the first name & second name

    Hi,

    I do not think there is a chance to figure out a formula that the name is composed of 1/2/3 segments.

    You can use this system: I hope practical.

    In D3:

    =LEFT(B3,FIND("@",SUBSTITUTE(B3," ","@",F3))-1)
    In E3

    =TRIM(SUBSTITUTE(B3;D3;""))
    In F3

    a helper column where you have to specify how many segments you need to extract as first names.

    Hope it helps
    Attached Files Attached Files

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Fomula to select the first name & second name

    Hi MAHMUZ,

    D3
    Please Login or Register  to view this content.
    E3
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Fomula to select the first name & second name

    Quote Originally Posted by MAHMUZ View Post
    ...what if i have more than 3 names like (first name, second name, Surname) what can be the formula condition?
    That rather depends on

    a) consistency of convention

    b) whether you want all but surname returned to Col D or just forename

    Assuming a consistent delimiter and that you want all but surname returned in First Name column then:

    Please Login or Register  to view this content.
    Obviously if you want just forename replace D3 with Pike's suggestion.

  5. #5
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    114

    Re: Fomula to select the first name & second name

    Thanks for every one participating in this case and i totally appreciate your effort whatsoever the result be.

    However all the suggested formula were just solving a part of my request because ever each formula has its own criteria, in column D or E, there is not unify formula which can gather both concept and there is no chance to get the name of any actors in three column like

    First Second Third
    Tom Hanks Mathew Tom Hanks Mathew
    Johnny Depp Colin Johnny Depp Colin

    BR

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Fomula to select the first name & second name

    The above makes little sense to me I'm afraid.

    I would suggest you post a further sample file with expected results for a wide variety of names should they contain 0, 1 or more middle names.

    Your earlier sample file was obviously of limited use given the nature of your question.

  7. #7
    Forum Contributor
    Join Date
    11-17-2009
    Location
    Kuwait
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    114

    Re: Fomula to select the first name & second name

    Quote Originally Posted by DonkeyOte View Post
    The above makes little sense to me I'm afraid.

    I would suggest you post a further sample file with expected results for a wide variety of names should they contain 0, 1 or more middle names.

    Your earlier sample file was obviously of limited use given the nature of your question.
    Dear DonkeyOte: Sorry to reply you late .

    The attached file will describe my request and also what the result should be looks like when you run the formula, either one formula covering the three columns, or one formula for each column.

    BR
    Attached Files Attached Files

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to select the first name & second name

    Based on your sample strings / expected results

    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)

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