• Code to extract text

    • This topic has 2 replies, 3 voices, and was last updated 16 years ago.
    Author
    Topic
    #459751

    Hi, I have the title, first and surnames of a list of people in one column, it is proving difficult for sorting. Is there code I can use to extract the title?

    Many thanks, Darren.

    Viewing 0 reply threads
    Author
    Replies
    • #1160060

      Hi, I have the title, first and surnames of a list of people in one column, it is proving difficult for sorting. Is there code I can use to extract the title?

      Many thanks, Darren.

      If the Title is the first item listed and is always seperted by a comma (,) from the first and surnaems; the below formula will extract the Title which then can be used to sort the data.

      =LEFT(A1,FIND(“,”,A1)-1)

      Tom Duthie

      • #1160070

        If the Title is the first item listed and is always seperted by a comma (,) from the first and surnaems; the below formula will extract the Title which then can be used to sort the data.

        =LEFT(A1,FIND(“,”,A1)-1)

        Tom Duthie

        Alternatively, if there’s a space separator:
        =LEFT(A1,FIND(” “,A1)-1)

        Cheers,
        Paul Edstein
        [Fmr MS MVP - Word]

    Viewing 0 reply threads
    Reply To: Code to extract text

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: