PDA

View Full Version : Solved: vlookup problems, even formatted as numbers



Gingertrees
06-03-2009, 08:29 AM
Hello,
I've been having trouble with vlookup in practice. Several sheets use vlookup to populate client info from the "Cases" sheet. I initially had this indexed by a text field, but other posts informed me that was problematic so I tried a numeric index instead. The problem I encounter is antime that index number is changed or deleted, everything else goes haywire. Suddenly client #4's info appears when I select client #1 or client #2. Or sometimes client #3;s info changes to all #N/A when called up. (Order is random).

I have attached a version of my workbook for your convenience. Please let me know if you have any ideas on how to fix this, thank you ever so much!!!
--Ginger

mdmackillop
06-03-2009, 08:56 AM
Add "False" as the last term of each VLOOKUP, This forces an exact match and ignores order. If you still have problems, let us know.
eg
=IF(H1<>"",VLOOKUP(H1,CLIENTS,2,FALSE)&" "&VLOOKUP(H1,CLIENTS,3,FALSE),"")

Gingertrees
06-03-2009, 11:13 AM
Thank you Mdmackillop! I tested that with my initial plan of indexing by a text field, and that worked beautifully with some test data I threw at it.

One more question: Is it really a huge problem to use vlookup with a text index? And are there safeguards I can put in place to keep it from crashing while working with text?
Reason I ask is 1)adding another column with autonumbers means I don't get to sleep tonight recoding all the references, since they're all designed to work with a text field there not a number, and 2) if I do use that text field for the index, I want to assure that the users are entering that ID as a specific number of characters.

Thoughts? Please let me know.
~Ginger

mdmackillop
06-03-2009, 11:17 AM
I don't see a problem with text. If you can use Data Validation on the input, it would reduce the chance of errors.

Gingertrees
06-03-2009, 11:45 AM
Woo-hoo! You so made my day. Thank you thank you thank you. :-)