ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Countif with parameters from another range? (https://www.excelbanter.com/excel-programming/393450-countif-parameters-another-range.html)

Kai Cunningham[_2_]

Countif with parameters from another range?
 
I need to count the instances on the word "Trane" in a range of cells, but
base the countif statement on the information in another range of cells. If
the parameter range has a "N" in it, then count the corresponding cell in the
counting range with "Trane" in it. If not, don't count it. This needs to be
a formula entered in one cell that displays the results of the countif. I
have tried this formula:
=COUNT(IF(($A$2:$A$297="N")*($O$2:$O$297="Trane"), $O$2:$O$297))
that is shown in the help section, but it only returns zeros when I use it.
Any help would be greatly appreciated!
-Kai

Rick Rothstein \(MVP - VB\)

Countif with parameters from another range?
 
I need to count the instances on the word "Trane" in a range of cells, but
base the countif statement on the information in another range of cells.
If
the parameter range has a "N" in it, then count the corresponding cell in
the
counting range with "Trane" in it. If not, don't count it. This needs to
be
a formula entered in one cell that displays the results of the countif. I
have tried this formula:
=COUNT(IF(($A$2:$A$297="N")*($O$2:$O$297="Trane"), $O$2:$O$297))
that is shown in the help section, but it only returns zeros when I use
it.
Any help would be greatly appreciated!


Give this formula a try...

=SUMPRODUCT(--($A$2:$A$297="N"),--($O$2:$O$297="Trane"))

Rick


Jim Thomlinson

Countif with parameters from another range?
 
You can do it with SumProduct... check out this link.

http://www.xldynamic.com/source/xld.SUMPRODUCT.html
--
HTH...

Jim Thomlinson


"Kai Cunningham" wrote:

I need to count the instances on the word "Trane" in a range of cells, but
base the countif statement on the information in another range of cells. If
the parameter range has a "N" in it, then count the corresponding cell in the
counting range with "Trane" in it. If not, don't count it. This needs to be
a formula entered in one cell that displays the results of the countif. I
have tried this formula:
=COUNT(IF(($A$2:$A$297="N")*($O$2:$O$297="Trane"), $O$2:$O$297))
that is shown in the help section, but it only returns zeros when I use it.
Any help would be greatly appreciated!
-Kai


Vergel Adriano

Countif with parameters from another range?
 
Kai,

Here's one way:

=SUMPRODUCT(($A$2:$A$297="N")*($O$2:$O$297="Trane" ))


--
Hope that helps.

Vergel Adriano


"Kai Cunningham" wrote:

I need to count the instances on the word "Trane" in a range of cells, but
base the countif statement on the information in another range of cells. If
the parameter range has a "N" in it, then count the corresponding cell in the
counting range with "Trane" in it. If not, don't count it. This needs to be
a formula entered in one cell that displays the results of the countif. I
have tried this formula:
=COUNT(IF(($A$2:$A$297="N")*($O$2:$O$297="Trane"), $O$2:$O$297))
that is shown in the help section, but it only returns zeros when I use it.
Any help would be greatly appreciated!
-Kai


Kai Cunningham[_2_]

Countif with parameters from another range?
 
Thanks a ton for the quick responses! Worked like a charm!
-Kai

"Vergel Adriano" wrote:

Kai,

Here's one way:

=SUMPRODUCT(($A$2:$A$297="N")*($O$2:$O$297="Trane" ))


--
Hope that helps.

Vergel Adriano


"Kai Cunningham" wrote:

I need to count the instances on the word "Trane" in a range of cells, but
base the countif statement on the information in another range of cells. If
the parameter range has a "N" in it, then count the corresponding cell in the
counting range with "Trane" in it. If not, don't count it. This needs to be
a formula entered in one cell that displays the results of the countif. I
have tried this formula:
=COUNT(IF(($A$2:$A$297="N")*($O$2:$O$297="Trane"), $O$2:$O$297))
that is shown in the help section, but it only returns zeros when I use it.
Any help would be greatly appreciated!
-Kai



All times are GMT +1. The time now is 04:27 PM.

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