ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Counting based on criteria from two cells??? (https://www.excelbanter.com/excel-worksheet-functions/162171-counting-based-criteria-two-cells.html)

bevpike

Counting based on criteria from two cells???
 
I want to count in the following table the number of records where ColA0 and
ColB=R:

ColA ColB
1000 R
1200 R
1300 R
0 R
11150 ADJ

I tried using SUMPRODUCT(--(colA_NAME0),--(colB_NAME="R"). I defined ColA
and ColB as named ranges.

This does not seem to work and from researching on the net it seems that it
should. Any suggestions??????

Thanks in advance,

Attila

PCLIVE

Counting based on criteria from two cells???
 
Use SUMPRODUCT. You must specify a range.


=SUMPRODUCT(--(A1:A1000),--(B1:B100="R"))

HTH,
Paul

--

"bevpike" wrote in message
...
I want to count in the following table the number of records where ColA0
and
ColB=R:

ColA ColB
1000 R
1200 R
1300 R
0 R
11150 ADJ

I tried using SUMPRODUCT(--(colA_NAME0),--(colB_NAME="R"). I defined
ColA
and ColB as named ranges.

This does not seem to work and from researching on the net it seems that
it
should. Any suggestions??????

Thanks in advance,

Attila




Ron Coderre

Counting based on criteria from two cells???
 
If the named ranges refer to entire columns....SUMPRODUCT won't work.
You'd need to specify a range.

Example:
=SUMPRODUCT(A:A) returns an error

but this one returns a correct value:
=SUMPRODUCT(A1:A1000)

Does that help?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)

"bevpike" wrote in message
...
I want to count in the following table the number of records where ColA0
and
ColB=R:

ColA ColB
1000 R
1200 R
1300 R
0 R
11150 ADJ

I tried using SUMPRODUCT(--(colA_NAME0),--(colB_NAME="R"). I defined
ColA
and ColB as named ranges.

This does not seem to work and from researching on the net it seems that
it
should. Any suggestions??????

Thanks in advance,

Attila




bevpike

Counting based on criteria from two cells???
 
Thank you, this did help.

Attila

"Ron Coderre" wrote:

If the named ranges refer to entire columns....SUMPRODUCT won't work.
You'd need to specify a range.

Example:
=SUMPRODUCT(A:A) returns an error

but this one returns a correct value:
=SUMPRODUCT(A1:A1000)

Does that help?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)

"bevpike" wrote in message
...
I want to count in the following table the number of records where ColA0
and
ColB=R:

ColA ColB
1000 R
1200 R
1300 R
0 R
11150 ADJ

I tried using SUMPRODUCT(--(colA_NAME0),--(colB_NAME="R"). I defined
ColA
and ColB as named ranges.

This does not seem to work and from researching on the net it seems that
it
should. Any suggestions??????

Thanks in advance,

Attila






All times are GMT +1. The time now is 10:02 AM.

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