+ Reply to Thread
Results 1 to 8 of 8

Data Cleansing- Separating 2 words

  1. #1
    Forum Contributor
    Join Date
    02-10-2013
    Location
    Wolverhampton
    MS-Off Ver
    Excel 2010
    Posts
    101

    Data Cleansing- Separating 2 words

    Hi, I have a column full of names of streets, I have separated the street names into a first word column and second word column, therefore, for the street name "Adam Road", the first word column contains the word "Adam", the second word column contains the word "Road",

    I used the Left and Right formulas to separate the names into two columns e.g. =LEFT(A1,FIND(" ",A1,1)-1) so
    "Adam" is placed in column B1, and =RIGHT(A1,LEN(A1)-FIND(" ",A1,1)) so Road is placed in column C2,

    My question is for a street name such as "Greenhill", where there is no second word, using the same Left formula gives me the "#VALUE" error, is there a Left formula which can place all first words into a column, regardless of whether the street name contains both two words (e.g. Adam Road") or one word (e.g. Greenhill).

    I would very much appreciate the help.
    Last edited by nav505; 02-12-2013 at 11:24 AM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Data Cleansing- Separating 2 words

    hi nav505, welcome to the forum. maybe:
    =IF(ISNUMBER(FIND(" ",A1)),LEFT(A1,FIND(" ",A1)-1),A1)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,938

    Re: Data Cleansing- Separating 2 words

    Try this:

    If(isblank(RIGHT(A1,LEN(A1)-FIND(" ",A1,1)),"",RIGHT(A1,LEN(A1)-FIND(" ",A1,1)))
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Contributor
    Join Date
    02-10-2013
    Location
    Wolverhampton
    MS-Off Ver
    Excel 2010
    Posts
    101

    Re: Data Cleansing- Separating 2 words

    Thanks, that is wonderful

  5. #5
    Forum Contributor
    Join Date
    02-10-2013
    Location
    Wolverhampton
    MS-Off Ver
    Excel 2010
    Posts
    101

    Re: Data Cleansing- Separating 2 words

    Also, is there a formula for the second word column that can give the second word of the street name (i.e.e Road for Adam Road) and also give a space when there is no second word in the street name (i.e. Greenhill)?

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,938

    Re: Data Cleansing- Separating 2 words

    I'm not understanding what you need. Please post and example of the data you have and the expected results so that we can have a clear picture of what you are looking to do.

  7. #7
    Forum Contributor
    Join Date
    02-10-2013
    Location
    Wolverhampton
    MS-Off Ver
    Excel 2010
    Posts
    101

    Re: Data Cleansing- Separating 2 words

    I have data as follows,

    STREET NAMES................FIRST WORD.............SECOND WORD
    Aldbury Mews..................Aldbury....................Mews
    Alden Avenue..................AldeN.......................Avenue
    Alder Close......................Alder.......................Close
    Aldermanbury...................Aldermanbury............#VALUE!
    Aldermans Hill...................Aldermans.................Hill
    Aldermans Walk................Aldermans..................Walk
    Alderminster Road.............Alderminster...............Road


    The previous formula that you posted can give the first word of all the street names, yet if there are no second words in the street name (i.e. Aldermanbury) then the SECOND WORD Column gives an error #VALUE, so I am asking whether there is a formula that can not only give the second word of the street name, but also give a space when there is no second word.
    Last edited by nav505; 02-12-2013 at 03:24 PM.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,938

    Re: Data Cleansing- Separating 2 words

    In column B =IF(ISERROR(LEFT(A2,FIND(" ",A2,1)-1)),A2,LEFT(A2,FIND(" ",A2,1)-1))

    In column C =IF(ISERR(RIGHT(A2,LEN(A2)-FIND(" ",A2,1))),"",RIGHT(A2,LEN(A2)-FIND(" ",A2,1)))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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