COUNTIF or COUNTIF

A

A.for.Andy

Hello All

I am trying to write a function so that if A or N appear in a row, the
number of occurances will be counted and logged. If the result = 0
then that row will be deleted. If have it working with a COUNTIF for
one variable, and I understand that nesting more than one does not
work. Despite searching, I have only found solutions for satisfying
two variables at once (ie. AND), however I need a function to count
whether an A OR an N OR both occur. (It is not the end of the world if
when both an A and an N are found the results are not summed to give
the total number of occurances...as long as the result retunred is <0
it would satisfy the need).

Any advice would be greatly appreciated

Andy
 
P

Pete_UK

I'm not sure from your description if A or N can appear together in
the same cell, but you could try this approach:

=COUNTIF(2:2,"A") + COUNTIF(2:2,"N")

which will be >0 if either A or N (alone) appears in row 2. If A or N
could be in the same cell, then you could include wildcards inthe
COUNTIF terms.

Hope this helps.

Pete
 
B

Bob Phillips

=SUM(COUNTIF(2:2,{"A","N"}))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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