Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default v-lookup error

I have a simple V-lookup formula in sheet1!A1:
=VLOOKUP($C$2,Names!$A:$C,2,FALSE)

Sometimes there is not a match and I get a #NA value. I want Sheet1!A1 to
equal "???" instead of #N/A when this happens. I would use an If statement
but don't know exactly how?
--
Thanks
Shawn
  #2   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default v-lookup error

Hi,

Try one of these:

=IF(COUNTIF(Names!$A:$A,$C$2),VLOOKUP($C$2,Names!$ A:$C,2,FALSE),"???")
=IF(ISNA(VLOOKUP($C$2,Names!$A:$C,2,FALSE)),"???", VLOOKUP($C$2,Names!$A:$C,2,FALSE))
=IF(ISERROR(VLOOKUP($C$2,Names!$A:$C,2,FALSE)),"?? ?",VLOOKUP($C$2,Names!$A:$C,2,FALSE))

Regards,
KL


"Shawn" wrote in message
...
I have a simple V-lookup formula in sheet1!A1:
=VLOOKUP($C$2,Names!$A:$C,2,FALSE)

Sometimes there is not a match and I get a #NA value. I want Sheet1!A1 to
equal "???" instead of #N/A when this happens. I would use an If
statement
but don't know exactly how?
--
Thanks
Shawn



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 296
Default v-lookup error

On Mon, 5 Sep 2005 13:27:25 +0200, "KL"
wrote:

Hi,

Try one of these:

=IF(COUNTIF(Names!$A:$A,$C$2),VLOOKUP($C$2,Names! $A:$C,2,FALSE),"???")
=IF(ISNA(VLOOKUP($C$2,Names!$A:$C,2,FALSE)),"???" ,VLOOKUP($C$2,Names!$A:$C,2,FALSE))
=IF(ISERROR(VLOOKUP($C$2,Names!$A:$C,2,FALSE)),"? ??",VLOOKUP($C$2,Names!$A:$C,2,FALSE))

Regards,
KL


"Shawn" wrote in message
...
I have a simple V-lookup formula in sheet1!A1:
=VLOOKUP($C$2,Names!$A:$C,2,FALSE)

Sometimes there is not a match and I get a #NA value. I want Sheet1!A1 to
equal "???" instead of #N/A when this happens. I would use an If
statement
but don't know exactly how?
--
Thanks
Shawn




Why wouldn't the simpler

=if(iserror(vlookup blah blah)),"???",vlookup(more blah))

suffice?

Rgds


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
  #4   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default v-lookup error

Hi,

"Richard Buttrey" wrote in message
Why wouldn't the simpler
=if(iserror(vlookup blah blah)),"???",vlookup(more blah))
suffice?


That was the third option I offered. The first option is the shortest, the
second only checks for a specific error and is shorter than the third one.
All three should be equal performance wise.

Regards,
KL


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
Lookup Error scott Excel Discussion (Misc queries) 1 December 31st 08 04:58 PM
lookup error??? Daniel Excel Worksheet Functions 6 October 18th 07 05:58 PM
LOOKUP error Kelly Excel Worksheet Functions 4 June 7th 07 11:47 PM
Lookup error Andmor Excel Discussion (Misc queries) 1 December 6th 06 10:51 PM
lookup error! via135 Excel Worksheet Functions 2 June 15th 06 08:55 PM


All times are GMT +1. The time now is 07:46 AM.

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

About Us

"It's about Microsoft Excel"