View Single Post
  #5  
Old April 26th, 2010, 03:32 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Finding matches in two columns

the IF will evaluate any number* greater than zero
as TRUE, zero as FALSE
*ie the number returned by the COUNTIF


That's correct in the context of this particular application.

To be more specific...

IF will evaluate *any number other than 0* as TRUE, zero as FALSE. Text will
return an error.

=IF(-1 = TRUE
=IF(0 = FALSE
=IF(0.00000000025 = TRUE
=IF(-0.03897 = TRUE
=IF(1E100 = TRUE
=IF("text" = #VALUE!

--
Biff
Microsoft Excel MVP


"Max" wrote in message
...
This is the base IF formula: IF(COUNTIF(A:A,B2),1,0)

COUNTIF(A:A,B2) returns the number of times that the value in B2 is found
within col A. If B2 is found once, you'd get 1 as the return, 2 if twice
and
so on.

Then .. the above used within the IF construct: IF(COUNTIF(A:A,B2),1,0)
the IF will evaluate any number* greater than zero as TRUE, zero as FALSE
*ie the number returned by the COUNTIF
--
Max
Singapore
---
"Erik" wrote:
Max, You are a genius and many thanks. Would you also be so kind to
explain
what is going on using IF and COUNTIF? Thanks,
Erik
--
Erik (a Word 2007 user)