• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Countif with or condition plus adding another criteria.

tomas

Active Member
Hi

In cell g4 you can see my formula which count number of occurances of defined combinations for values in b and c column. ( I found a formula and adjusted to my need). But I failed to add another condition that value in column A should be equal to values in my F column.

Please can you help to expand/

regards
 

Attachments

  • countif or.xlsx
    161.2 KB · Views: 16
Hi

No the formula I put so far follows the logic that it counts row if value in b or c column is not equal 0. For this formula works but not sure how to expand to add class condition.

I know easy solution is calculated column but would prefer not to do that
 
can u please explain me why there is two time "<" & ">" in criteria s
Hi ,

That is because that is how the OP wants to get the count.

He wishes to apply the following 3 criteria one after the other , and add all 3 counts to get the final output.

First , let us understand that the data in columns B and C are as follows :

1. The data in column B is either 0 or greater than 0.

2. The data in column C is either 0 or less than 0.

The criteria are :

1. Count all those cells which have column B greater than 0 AND column C less than 0. Let us call this COUNT1. You can see from the data that this value is 621.

2. Count all those cells which have column B greater than 0 AND column C equal to 0. Let us call this COUNT2. You can see from the data that this value is 6058.

3. Count all those cells which have column B equal to 0 AND column C less than 0. Let us call this COUNT3. You can see from the data that this value is 94.

The overall count , the final output , is therefore :

COUNT1 + COUNT2 + COUNT3 which equals 6773.

Of course , this could have been simplified to using just 2 criteria , by combining either COUNT1 and COUNT2 or COUNT1 and COUNT3. The two counts would be :

Combining COUNT1 and COUNT2

1. Count all those cells which have column B greater than 0 AND column C less than or equal to 0. Let us call this COUNT12. You can see from the data that this value would be 6679.

3. Count all those cells which have column B equal to 0 AND column C less than 0. Let us call this COUNT3. You can see from the data that this value is 94.

Thus , the final output would be :

COUNT12 + COUNT3 which would equal 6773.


Combining COUNT1 and COUNT3

1. Count all those cells which have column B greater than or equal to 0 AND column C less than 0. Let us call this COUNT13. You can see from the data that this value would be 715.

2. Count all those cells which have column B greater than 0 AND column C equal to 0. Let us call this COUNT2. You can see from the data that this value is 6058.

Thus , the final output would be :

COUNT13 + COUNT2 which would equal 6773.

Narayan
 
Back
Top