I am trying to count rows in a two-column range where at least one of the columns has a value. If both columns have values in the same row, I only want to count that row once.
It doesn't matter which column is counted when both have values, as long as that row is not counted twice.
Col A | Col B |
---|---|
Red | |
Blue | |
Fruit | |
Yellow | Banana |
The answer I'm looking for in this example is 4.
I'm using Google Sheets.
CodePudding user response:
Use filter()
, like this:
=rows(filter(A2:B, not(isblank(A2:A) * isblank(B2:B))))