Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Blanks in VLookUP

What code could be added to this formula, such that if P16
is blank, the cell holding this formula would also be
blank? What I get now is an error (#N/A) when P16 is
blank.

=VLOOKUP(P16,P28:R33,3)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Blanks in VLookUP

Try

=IF(ISNA(VLOOKUP(P16,P28:R33,3)),0,VLOOKUP(P16,P28 :R33,3))

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Phil Hageman" wrote in message ...
What code could be added to this formula, such that if P16
is blank, the cell holding this formula would also be
blank? What I get now is an error (#N/A) when P16 is
blank.

=VLOOKUP(P16,P28:R33,3)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Blanks in VLookUP

Phil,

=IF(ISNA(yourlookup),0,yourlookup)

an example:
=IF(ISNA(VLOOKUP(P16,P28:R33,3)),0,VLOOKUP(P16,P28 :R33,3))
or
=IF(ISNA(VLOOKUP(P16,P28:R33,3)),"",VLOOKUP(P16,P2 8:R33,3))

John

"Phil Hageman" wrote in message
...
What code could be added to this formula, such that if P16
is blank, the cell holding this formula would also be
blank? What I get now is an error (#N/A) when P16 is
blank.

=VLOOKUP(P16,P28:R33,3)



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Blanks in VLookUP

Perhaps the advantage of the solution posted by Tom and John is that it will
cater for other not found situations rather than just blank ... though the
OP did say specifically blanks.

Regards

Trevor


"whisperer" wrote in message
...
Relying on the 'fact'that P16 is either blank or contains the lookup
criteria, the following code is a simpler and faster version of the
other suggestions. Faster in that it does not need to do a Vlookup
twice. Mind you if you can measure the speed difference I will be very
surprised.

=IF(P16="","",VLOOKUP(P16,P28:R33,3))

Best Wishes :)



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
Sum Vlookup where there are blanks KneeDown2Up Excel Discussion (Misc queries) 2 May 10th 10 10:30 PM
VLOOKUP using FALSE returning blanks and #N/A dread Excel Worksheet Functions 1 September 16th 08 10:18 PM
Vlookup blanks = zeros Marilyn Excel Discussion (Misc queries) 6 March 18th 07 01:21 AM
Excel 2002 : Why VLOOKUP formula does not show blanks or N/A ? Mr. Low Excel Discussion (Misc queries) 3 February 5th 07 02:26 PM
blanks instead of "0" in vlookup Patty via OfficeKB.com Excel Discussion (Misc queries) 2 July 8th 05 10:47 PM


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

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"