+ Reply to Thread
Results 1 to 2 of 2

Vlookup when more than one possiblity

  1. #1
    samenvoegen van sheets
    Guest

    Vlookup when more than one possiblity

    Hello,

    I'm using the VLOOKUP function to find some place's code within a table.
    My problem is that some places in the world are writen the same way but are
    not in the same contry and so don't have the same code.
    now if i'm using the Vlookup it will only take the first name and sometimes
    the wrong code.
    How can i do, to let the function make an error if there are two or more
    similair places?


    thks in advance,
    Flo


  2. #2
    Ian Nolan
    Guest

    Re: Vlookup when more than one possiblity

    Flo,

    A simple way to resolve this would be to create a new column in your
    lookup table that has the count of the name your looking up. It would mean
    you'd have to do two lookups - one for the country and another telling you
    how many occurences there are of that word. You could, if you wish combine
    these results via an if statement so it returns an indication that the
    name is not unique.

    Something like

    IF(AND(NOT(ISNA((vlookup(country,code_list,column_num,false))),vlookup(country,code_list,column_number_of_country_count,false)=1),vlookup(country,code_list,column_num,false),"NON-UNIQUE/NON-EXISTENT
    COUNTRY")

    should work, and could be refined to differentiate between non-existent
    and non-unique.

    Hope this helps,
    Regards,
    Ian.


+ 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