Ask Search:
Praveen JaswalPraveen Jaswal 

vlookup Function

Hi All - Can anybody please let me know how to use vlookup Function in SF. Please provide me some examples if you have.

I want to use it to Validate Zip/Postal Code, State and Country Fields. I have added a custom object with the details of all the countries, their states and Zip and i am trying to reference this custom object through vlookup function but unable to get this done.

Please suggest.

Thanks & Regards,
Praveen

Praveen JaswalPraveen Jaswal
I saw this example in the help article but then also unable to get it right.
Amanda K HowellAmanda K Howell
Did you ever get an answer on this?  Based on the way you worded your question I am thinking that the issue may be in how you put your data in for your custom object that the vlookup is supposed to search.  You need a new record for every single Zipcode, State and Country option.  So you can't have a record for every Country and then within those country records have all of their states and zip codes listed.  You have to expand it out and have a record for everything.  In this case it would need to be a record for every zip code since that is the farthest out branch in your line.
Sujit NirkheSujit Nirkhe
First of all clear idea about vlookup, how it works.
Then u will understand vlookup here.(I understood vlookup in this manner. So u can try it.)
See this:www.youtube.com/watch?v=KXhM-wBM7U4
M NaveenM Naveen
vlookup function is used to bring relevent value to that record from another record automatically
Praveen Jaswal (Sops)Praveen Jaswal (Sops)
Vlookup in SF can only be used to compare the values we can't pull out values as we do in excel.

This is how i applied the validation.

AND((OR(Country = "USA",Country = "Australia",Country = "Canada")), VLOOKUP( $ObjectType.State_Abbreviation__c.Fields.Country__c,
$ObjectType.State_Abbreviation__c.Fields.Name,
State )<> Country
)
Avinash KaltariAvinash Kaltari
Hi Praveen,

Just to confirm and get it right, the formula you have written return TRUE only if the selected State does NOT belong to either USA/Canada or Australia. 

Is that correct?