Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 683
Default Return 0 instead of #n/a

I'm using some vlookup formulas to verify dates, and I want to get a "0"
response for dates that are not in my lookup list rather than "#n/a".
Any suggestions on a formula?
I tried =if(vlookup(date,A1:A500,1,0)=1,1,0)
However this still giving me a #n/a answer.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Return 0 instead of #n/a

Handle NA() using ISNA function

=IF(ISNA(lookupformula),0,lookupformula)

If this post helps click Yes
---------------
Jacob Skaria


"Brian" wrote:

I'm using some vlookup formulas to verify dates, and I want to get a "0"
response for dates that are not in my lookup list rather than "#n/a".
Any suggestions on a formula?
I tried =if(vlookup(date,A1:A500,1,0)=1,1,0)
However this still giving me a #n/a answer.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Return 0 instead of #n/a

It's looking like you're returning a 1 if the date is found in that range.

You could use:
=--(isnumber(match(yourdate,a1:a500,0)))

=match() returns the number of the row in the range that matches (if there's a
match). Otherwise, it returns an error.

=isnumber() returns true or false

and the -- stuff converts those False's to 0's and the True's to 1.



Brian wrote:

I'm using some vlookup formulas to verify dates, and I want to get a "0"
response for dates that are not in my lookup list rather than "#n/a".
Any suggestions on a formula?
I tried =if(vlookup(date,A1:A500,1,0)=1,1,0)
However this still giving me a #n/a answer.

Thanks


--

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
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null Ben Excel Discussion (Misc queries) 2 March 15th 07 01:02 AM
How to return 1 with #VALUE!? Eric Excel Discussion (Misc queries) 2 January 21st 07 04:07 PM
LOOKUP and return the column heading for IF/THEN return for False NN Excel Discussion (Misc queries) 1 October 6th 06 11:24 AM
check if reference exists, then return its value or return 0 doudou Excel Worksheet Functions 1 June 4th 05 09:17 PM
I need to return "" instead of 0 dave roth Excel Worksheet Functions 2 March 21st 05 09:33 PM


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