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

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
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top