View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Find a Cell Value In a Range

Damn! I can't believe I left out the double unary... AGAIN... I seem to have
this mental block about typing them for some reason. Thanks for noting that.

Rick


"Wigi" wrote in message
...
Well Rick

I could have left out the IF, but you need that one to return 1 and 0, not
TRUE and FALSE. That's how I read the question.

Another way to get 1 and 0 is:

=--(COUNTIF(range,valuetolookup)0)


--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Rick Rothstein (MVP - VB)" wrote:

Since the desired results are 1 if true and 0 if false, you can eliminate
the IF function call...

=COUNTIF(range,valuetolookup)0

Rick


"Wigi" wrote in message
...

COUNTIF function does this for you.

=IF(COUNTIF(range,valuetolookup)0,1,0)



--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Michael" wrote:

I would like to look-up a cell's value in a range of cells and return
1
if it
exists or zero if it does not exist in the specified range. I have got
to
believe this is a fairly common need. Can anyone help me out with
this.