ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Countif/And Function (https://www.excelbanter.com/excel-discussion-misc-queries/25571-countif-function.html)

acyakos

Countif/And Function
 
I am trying to count the number of occurrences in a column based on two
criteria. For example, I would like to count how many times the letter 'N'
appears in column E, but only if the value in column A is equal to 0016. Can
this be done using the COUNTIF or AND functions?? (basically I would like to
count the number of cells in column E with a value of N in column E AND a
value of 0016 in column A)

Hopefully this makes sense...

Thanks!

Domenic

Try...

=SUMPRODUCT(--(A1:A100="0016"),--(E1:E100="N"))

OR

=SUMPRODUCT(--(A1:A100=G1),--(E1:E100=H1))

....where G1 contains your first criterion, such as 0016, and H1 contains
your second, such as N.

Hope this helps!

In article ,
"acyakos" wrote:

I am trying to count the number of occurrences in a column based on two
criteria. For example, I would like to count how many times the letter 'N'
appears in column E, but only if the value in column A is equal to 0016. Can
this be done using the COUNTIF or AND functions?? (basically I would like to
count the number of cells in column E with a value of N in column E AND a
value of 0016 in column A)

Hopefully this makes sense...

Thanks!


acyakos

Thanks so much Domenic! That works perfectly and saves a lot of time.

"Domenic" wrote:

Try...

=SUMPRODUCT(--(A1:A100="0016"),--(E1:E100="N"))

OR

=SUMPRODUCT(--(A1:A100=G1),--(E1:E100=H1))

....where G1 contains your first criterion, such as 0016, and H1 contains
your second, such as N.

Hope this helps!

In article ,
"acyakos" wrote:

I am trying to count the number of occurrences in a column based on two
criteria. For example, I would like to count how many times the letter 'N'
appears in column E, but only if the value in column A is equal to 0016. Can
this be done using the COUNTIF or AND functions?? (basically I would like to
count the number of cells in column E with a value of N in column E AND a
value of 0016 in column A)

Hopefully this makes sense...

Thanks!




All times are GMT +1. The time now is 07:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com