Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using OR & AND in COUNTIFS

I would like to include an "AND" condition for one of the conditions I have in my COUNTIFS clause.

Something like this:

=COUNTIFS(A1:A196;{"Yes"or "NO"};J1:J196;"Agree")

So, it should return the number of rows where:

 (A1:A196 is either "yes" or "no") AND (J1:j196 is "agree")
like image 342
Sammy Avatar asked May 14 '14 13:05

Sammy


People also ask

What is a sentence using or?

[M] [T] You must decide whether you will go by train or by plane. [M] [T] Do you spend more time with your friends or with your family? [M] [T] I haven't decided yet whether I'll go to college or get a job. [M] [T] She was asked to convince him to get his son or someone else to paint the house.

Can I use two or in a sentence?

You may use X or Y or Z or even something else. And what is proper punctuation for such example in case it is valid. The use of multiple conjunctions in quick succession could be a rhetorical device called polysyndeton, but you should probably only use it when trying to achieve a certain effect with your writing.

What does the use of and/or in sentence mean?

ˈand-ˈȯr. used as a function word to indicate that two words or expressions are to be taken together or individually. language comprehension and/or production David Crystal.

Did he use or used?

Use to: Usages (with 'Did')The form considered correct following did, at least in American English, is use to. Just as we say "Did he want to?" instead of "Did he wanted to?," so we say "Did he use to?" instead of "Did he used to?" Here again, only in writing does the difference become an issue.


Video Answer


1 Answers

You could just add a few COUNTIF statements together:

=COUNTIF(A1:A196,"yes")+COUNTIF(A1:A196,"no")+COUNTIF(J1:J196,"agree")

This will give you the result you need.

EDIT

Sorry, misread the question. Nicholas is right that the above will double count. I wasn't thinking of the AND condition the right way. Here's an alternative that should give you the correct results, which you were pretty close to in the first place:

=SUM(COUNTIFS(A1:A196,{"yes","no"},J1:J196,"agree"))
like image 194
tmoore82 Avatar answered Sep 20 '22 06:09

tmoore82