+ Reply to Thread
Results 1 to 6 of 6

Extract City from Address

  1. #1
    Forum Contributor
    Join Date
    10-20-2005
    Posts
    127

    Extract City from Address

    Hi All,

    I have a list of addresses from which I need to extract city for that location from another list of cities to cell corresponding to address. I tried using vlookup but it didn't help. Can anyone of you look into file & suggest me proper solution.


    Thanks in Advance.
    Attached Files Attached Files
    Regards,
    Little Master

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extract City from Address

    see attached i prepared an unique list of cities in column a having duplicates is just clutter
    then used =LOOKUP(2^15,SEARCH($A$2:$A$138,E2),$A$2:$A$138) in column g dragged down
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor
    Join Date
    10-20-2005
    Posts
    127

    Re: Extract City from Address

    Thanx a billion martin... it worked for me... thnx again....

  4. #4
    Forum Contributor
    Join Date
    10-20-2005
    Posts
    127

    Re: Extract City from Address

    The formula is working absolutely fine with me, I have even understood the formula. But the only thing I am curious about is "2^15" used in formula. Can someone pls put some light on it & tell me y this was used & what does this mean. Thanks in advance

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extract City from Address

    10^308 or 9.999999999E+307 is the biggest number you can use
    2^15=32768
    its just that you must use a bigger number than you are likely to be searching for so lookup returns

    If LOOKUP can't find the lookup_value, it matches the largest value in lookup_vector that is less than or equal to lookup_value.

  6. #6
    Registered User
    Join Date
    01-05-2006
    Location
    Toronto, Ontario
    MS-Off Ver
    2007
    Posts
    38

    Re: Extract City from Address

    I tried the formula, but run into a little trouble. Say a record like this:

    255 SIMCOE ST N APT 505 OSHAWA L1G 4T4, ONTARIO

    Oshawa is the tarket, but both Oshawa and Simcoe appear in the lookup list. Because Simco comes last in the a-z, it gets picked.

    Is there a way to search from the left side a certian number of spaces?

    Thanks
    Terry

+ 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