View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Teddy-B Teddy-B is offline
external usenet poster
 
Posts: 76
Default Lookup Working TOO Well

Here is a lookup formula I made for the user to enter a unique four digit #
into a spreadsheet (D2) and have correlating data returned (don't worry, I
made a preliminary sort macro for the data list "VOUCH"):

=IF(D20,LOOKUP($D2,VOUCH!D$2:D$5000,VOUCH!C$2:C$5 000),"")

The problem is that if and when the user enters a # incorrectly or a # that
is not on the list....Excel automatically looks up the closest match on the
data list and returns THAT-WRONG correlating data.

Is there a way to tell Excel to return a message to the user that the # is
not existent / incorrect? Or is there a way to limit the lookup return to
specific #'s ONLY on the "VOUCH" list?