ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   COUNTIF() With multiple ranges and variables (https://www.excelbanter.com/excel-discussion-misc-queries/98842-countif-multiple-ranges-variables.html)

Thansal

COUNTIF() With multiple ranges and variables
 
The function I am looking for is something that will simply look at 2
ranges (euqaly large) and only count them if they meet 2 criteria on
the same row

EX:

A B
1 1
1 2
1 3
2 1
2 2
2 3

So what I am sorta looking for is something that would count the
instances where A = 1 and B 1.

I can't figgure out a propper function for this.

Any help would be appreciated.

AlexV


Ardus Petus

COUNTIF() With multiple ranges and variables
 
=SUMPRODUCT((A1:A1000=1)*(B1:B10001))

HTH
--
AP

"Thansal" a écrit dans le message de news:
...
The function I am looking for is something that will simply look at 2
ranges (euqaly large) and only count them if they meet 2 criteria on
the same row

EX:

A B
1 1
1 2
1 3
2 1
2 2
2 3

So what I am sorta looking for is something that would count the
instances where A = 1 and B 1.

I can't figgure out a propper function for this.

Any help would be appreciated.

AlexV




Sloth

COUNTIF() With multiple ranges and variables
 
=SUMPRODUCT(--(A1:A6=1),--(B1:B61))

"Thansal" wrote:

The function I am looking for is something that will simply look at 2
ranges (euqaly large) and only count them if they meet 2 criteria on
the same row

EX:

A B
1 1
1 2
1 3
2 1
2 2
2 3

So what I am sorta looking for is something that would count the
instances where A = 1 and B 1.

I can't figgure out a propper function for this.

Any help would be appreciated.

AlexV



Thansal

COUNTIF() With multiple ranges and variables
 
Thank you all.

It took me a long time, but that was b/c I had an error in my data that
I had not caught.
Sloth wrote:
=SUMPRODUCT(--(A1:A6=1),--(B1:B61))

"Thansal" wrote:

The function I am looking for is something that will simply look at 2
ranges (euqaly large) and only count them if they meet 2 criteria on
the same row

EX:

A B
1 1
1 2
1 3
2 1
2 2
2 3

So what I am sorta looking for is something that would count the
instances where A = 1 and B 1.

I can't figgure out a propper function for this.

Any help would be appreciated.

AlexV





All times are GMT +1. The time now is 06:47 PM.

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