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,
FloFlo,
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_numb er_of_country_count,false)=1),vlookup(country,code _list,column_num,false),quot;NON-UNIQUE/NON-EXISTENT
COUNTRYquot;)
should work, and could be refined to differentiate between non-existent
and non-unique.
Hope this helps,
Regards,
Ian.
- Nov 03 Mon 2008 20:47
Vlookup when more than one possiblity
close
全站熱搜
留言列表
發表留言
留言列表

