Search code examples
google-sheetsformulas

How to compare values between two rows with a condition


I have values in two rows and I need to compare the cells in each column except the ones where is one of the two cells (or both of them) blank and get a result of how many values in row 4 is greater than the ones in row 5.

It looks like this Example

The result in this case should be 3.

Is there any way how to do it only with one formula?


Solution

  • =ArrayFormula(SUM((4:4>5:5)*(4:4<>"")*(5:5<>"")))

    • (A) * (B) * (C) ... - and logic
    • (A) + (B) + (C) ... - or logic