ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   countif formula accross two columns (https://www.excelbanter.com/excel-discussion-misc-queries/127660-countif-formula-accross-two-columns.html)

Afsha

countif formula accross two columns
 
I have two coulumns with values. i want to count number of records which are
more than 0 in both columns. E.g:
Column A Coulumn B
0 0
5 6
0 1
3 2

Therefore I want the answer to come back as 2 as two rows have both columns
with a value of more than 0.

thanks
Afsha

pinmaster

countif formula accross two columns
 
Hi,

Perfect for a sumproduct function:

=SUMPRODUCT((A1:A100)*(B1:B100))

Cheers!
Jean-Guy

"Afsha" wrote:

I have two coulumns with values. i want to count number of records which are
more than 0 in both columns. E.g:
Column A Coulumn B
0 0
5 6
0 1
3 2

Therefore I want the answer to come back as 2 as two rows have both columns
with a value of more than 0.

thanks
Afsha


JLatham

countif formula accross two columns
 
Another way to write it:
=SUMPRODUCT(--(A1:A40), --(B1:B40))

but pinmaster's is shorter and both give the same result.

"Afsha" wrote:

I have two coulumns with values. i want to count number of records which are
more than 0 in both columns. E.g:
Column A Coulumn B
0 0
5 6
0 1
3 2

Therefore I want the answer to come back as 2 as two rows have both columns
with a value of more than 0.

thanks
Afsha


Afsha

countif formula accross two columns
 
thank you both!

"JLatham" wrote:

Another way to write it:
=SUMPRODUCT(--(A1:A40), --(B1:B40))

but pinmaster's is shorter and both give the same result.

"Afsha" wrote:

I have two coulumns with values. i want to count number of records which are
more than 0 in both columns. E.g:
Column A Coulumn B
0 0
5 6
0 1
3 2

Therefore I want the answer to come back as 2 as two rows have both columns
with a value of more than 0.

thanks
Afsha



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

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