Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Function(?) to Extract from Excel cells

  • 14-09-2006 6:07pm
    #1
    Closed Accounts Posts: 373 ✭✭


    I have a list in Excel that looks like:

    Brian B. Byrne
    John Doyle
    Bob X. Hope
    Jimmy O'Reilly
    Betty Boo
    Johnny O' Murtagh


    I need to get it into two columns looking like:
    Brian
    John
    Bob
    Jimmy
    Betty
    Johnny

    and

    Byrne
    Doyle
    Hope
    O'Reilly
    Boo
    O' Murtagh


    I.e. first names and last names.

    First name extraction is easy - search for position of first space and then use function to remove to that number of characters.

    What can I use for Surnames though?
    A function that searches from Right for first space and then extracts from Right to that num characters would do it (i.e. exact oposite of what I used for first name) but that doesnt seem to exist.
    Obviously that would not take care of cases such as:
    Johnny O' Murtagh ; where the formatting is a little different but I could live with that... unless someone has an idea that will take care of that too?


Comments

  • Registered Users, Registered Users 2 Posts: 944 ✭✭✭SwampThing


    quick and nasty...

    first name
    =LEFT(A1,FIND(" ",A1))

    surname
    =MID(A1, FIND(" ",A1,1),99)


  • Closed Accounts Posts: 373 ✭✭Faltermyer


    That wont do surname because it will give me middle initials also??


  • Registered Users, Registered Users 2 Posts: 944 ✭✭✭SwampThing


    OK, OK - keep your shirt on :)

    surname...

    first, this into column B
    =TRIM(MID(A2, FIND(" ",A2,1),99))

    and then this into column C
    =IF(ISNUMBER(FIND(".",B2)),TRIM(MID(B2,FIND(".",B2)+1,99)),TRIM(B2))


Advertisement