Home > Software engineering >  Count rows from 2 columns when sum between 2 cells is non-zero in Excel
Count rows from 2 columns when sum between 2 cells is non-zero in Excel

Time:10-18

I want to count the rows when sum between cells of C and D columns is non-zero (i.e. greater than 0). As shown in image, I want to calculate value using formula which should be 3. I tried countif and countifs formula, but not giving expected result.

Any help would be appreciated.

enter image description here

CodePudding user response:

Try:

=SUM(N(MMULT(C2:D5,{1,1})>0))

CodePudding user response:

If you have Excel 365 you can use:

=SUM(--(BYROW(C2:D5,LAMBDA(r,SUM(r )))>0))

BYROW creates kind of a helper column summing the value per row - and then checks if > 0

CodePudding user response:

A simple solution with a helper column: enter image description here

  • Related