Use of '=AND( COUNTIF(A:A, B1))' to check if a cell is in a column or range

  • Thread starter Thread starter sillyhat
  • Start date Start date
S

sillyhat

Hello.

Can someone please help, I'm using Excel 2003 and I wondered if this is
an efficient way of checking whether an item is is a column or part of
a column of (length 5000 rows) or not: -
=AND( COUNTIF(A:A, B1) )

It seems like an odd use of the AND function as it only has one
parameter but it returns a TRUE or FALSE as you would expect.

I don't want to count the number of occurences, I just want to know if
the value is present in the column but I can't seem to find an
alternative to COUNTIF.

The IF and FIND commands don't seem to apply here.

Thanks for any help given.
Hal
 
The AND is used to force a Boolean result, otherwise you get 0,1,2,etc.

You could do the same with

=COUNTIF(A:A,B1)>0

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 
Back
Top