#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default exact VLookup

Need to create a vlookup, but if the vlaue is not found to bring back a word
rather than the nearest number.

eg looking up number 99 and if my name range data stops at 80 it brings back
the value next to the 80.

all the code I've done so far is =vlookup(A1,MyNamedRange,2)

looking up whatever is in A1, looking for this in my named range, then
brining back the value in column 2 of the named range.

I know there's a way, to bring back only the exact match eg if there is no
99 then say Not found or leave empty?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default exact VLookup

=IF(ISNA(VLOOKUP(A1,MyNamedRange,2,FALSE)),"NotFou nd",VLOOKUP(A1,MyNamedRange,2,FALSE))

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"gigglygover" wrote in message ...
| Need to create a vlookup, but if the vlaue is not found to bring back a word
| rather than the nearest number.
|
| eg looking up number 99 and if my name range data stops at 80 it brings back
| the value next to the 80.
|
| all the code I've done so far is =vlookup(A1,MyNamedRange,2)
|
| looking up whatever is in A1, looking for this in my named range, then
| brining back the value in column 2 of the named range.
|
| I know there's a way, to bring back only the exact match eg if there is no
| 99 then say Not found or leave empty?
|


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default exact VLookup

If I've understood correctly, try this

=VLOOKUP(A1,MyNamedRange,2,TRUE)

Mike

"gigglygover" wrote:

Need to create a vlookup, but if the vlaue is not found to bring back a word
rather than the nearest number.

eg looking up number 99 and if my name range data stops at 80 it brings back
the value next to the 80.

all the code I've done so far is =vlookup(A1,MyNamedRange,2)

looking up whatever is in A1, looking for this in my named range, then
brining back the value in column 2 of the named range.

I know there's a way, to bring back only the exact match eg if there is no
99 then say Not found or leave empty?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default exact VLookup

The 4th argument in the =vlookup() function tells it to look for an exact
match. The default (missing this 4th argument) is not to have an exact match.

So try:
=vlookup(a1,mynamedrange,2,false)

To avoid the #n/a error when there isn't a match:
=if(isna(vlookup(...)),"Missing",vlookup(...))

If you're using xl2007, you could use:
=iferror(vlookup(...),"Missing")







gigglygover wrote:

Need to create a vlookup, but if the vlaue is not found to bring back a word
rather than the nearest number.

eg looking up number 99 and if my name range data stops at 80 it brings back
the value next to the 80.

all the code I've done so far is =vlookup(A1,MyNamedRange,2)

looking up whatever is in A1, looking for this in my named range, then
brining back the value in column 2 of the named range.

I know there's a way, to bring back only the exact match eg if there is no
99 then say Not found or leave empty?


--

Dave Peterson
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
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 where text not exact Janicej Excel Discussion (Misc queries) 2 August 19th 06 08:57 PM
vlookup more than one exact match Russ B Excel Worksheet Functions 6 July 25th 05 08:24 PM
How to get an exact mactch with Vlookup Grd Excel Worksheet Functions 2 April 26th 05 05:16 PM


All times are GMT +1. The time now is 08:03 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"