Nested Countif statements

crimlet

Board Regular
Joined
May 2, 2002
Messages
136
Is it possible to nest countif statements, if so could someone post some examples ?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I don't think it makes sense to nest them, since the reult of countif is just a number (a count), and the input to the outer countif would need to be a range or data value. Probably the results of the previous countif would not be a useful data value to use in the outer countif.

However, it is possible to add the results together, which corresponds to the logic of "count cells with either value1 or value2". For example:

=countif(A2:A20,"value1")+countif(A2:A20,"value2")

Or you can do some number range expressions, for example

=countif(A2:A20,"<= value2")-countif(A2:A20,"< value1")

should count the number of cells with values between value1 and value2, including any cells containing exactly value1 or value2 values.
 
Upvote 0
I don't think it makes sense to nest them, since the reult of countif is just a number (a count), and the input to the outer countif would need to be a range or data value.

I disgree,

I often need to countif if first name = ?? and date start = ?? and paycode = ??.

three diferent ranges three types of data.

SUMPRODUCT should be the way forward or a Dfunction.

But as asked by Aladin, we need to be clear on the problem.
 
Upvote 0

Forum statistics

Threads
1,218,660
Messages
6,143,747
Members
450,502
Latest member
sakaria_123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top