Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Vlookup & exact match

In my worksheet/form a user enters a policy number in B5 to search for
details.
B6 holds the vlookup formula which displays their info.

But if a non-existing policy is entered in B5, B6 shows the next closest
match. How do I force an exact match & give some sort of error message when
an invalid # has been entered ? Thanks!

=VLOOKUP(B5,List2,2)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,440
Default Vlookup & exact match

=VLOOKUP(B5,List2,2,FALSE)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Munchkin" wrote in message
...
In my worksheet/form a user enters a policy number in B5 to search for
details.
B6 holds the vlookup formula which displays their info.

But if a non-existing policy is entered in B5, B6 shows the next closest
match. How do I force an exact match & give some sort of error message
when
an invalid # has been entered ? Thanks!

=VLOOKUP(B5,List2,2)


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Vlookup & exact match

Munchkin wrote:
In my worksheet/form a user enters a policy number in B5 to search for
details.
B6 holds the vlookup formula which displays their info.

But if a non-existing policy is entered in B5, B6 shows the next closest
match. How do I force an exact match & give some sort of error message when
an invalid # has been entered ? Thanks!

=VLOOKUP(B5,List2,2)


Check the help file under VLOOKUP.


Syntax

VLOOKUP(lookup_value,table_array,col_index_num,ran ge_lookup)

Range_lookup is a logical value that specifies whether you want VLOOKUP to find
an exact match or an approximate match. If TRUE or omitted, an approximate match
is returned. In other words, if an exact match is not found, the next largest
value that is less than lookup_value is returned. If FALSE, VLOOKUP will find an
exact match. If one is not found, the error value #N/A is returned.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Vlookup & exact match

OK - I got the "False" part, which is great. But I still want some kind of
error message to pop up to tell the user that the policy number they entered
was not found. "False" automatically enters the "#N/A" error message. Any
ideas?

"Munchkin" wrote:

In my worksheet/form a user enters a policy number in B5 to search for
details.
B6 holds the vlookup formula which displays their info.

But if a non-existing policy is entered in B5, B6 shows the next closest
match. How do I force an exact match & give some sort of error message when
an invalid # has been entered ? Thanks!

=VLOOKUP(B5,List2,2)

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 27
Default Vlookup & exact match


Munchkin,

try using this,

=IF(ISERROR(VLOOKUP(C8,A8:A12,1,FALSE))=TRUE,"No
Match",VLOOKUP(C8,A8:A12,1,FALSE))


Value list is from A8 to A12 and you are matching values in C8.


--
Sheikh Saadi


"Munchkin" wrote:

In my worksheet/form a user enters a policy number in B5 to search for
details.
B6 holds the vlookup formula which displays their info.

But if a non-existing policy is entered in B5, B6 shows the next closest
match. How do I force an exact match & give some sort of error message when
an invalid # has been entered ? Thanks!

=VLOOKUP(B5,List2,2)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exact Match in Vlookup Mark Allen Excel Discussion (Misc queries) 5 November 10th 08 02:40 PM
vlookup exact match Jo Excel Discussion (Misc queries) 2 October 10th 08 02:32 PM
VLookup - Not Exact Match vmagal1 Excel Worksheet Functions 2 May 11th 07 04:39 PM
Using Exact() with VLookup or Match mikelee101 Excel Worksheet Functions 6 March 15th 07 05:59 PM
vlookup more than one exact match Russ B Excel Worksheet Functions 6 July 25th 05 08:24 PM


All times are GMT +1. The time now is 01:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"