Google-sheets – How to compare each value from two rows column by column and put the result in one cell in Google Spreadsheets

google sheets

I have something like this

Row

1->   1   3   4   2   1   1

2->   2   1   3   4   2   2

I want to find how many values of row 1 are greater than the ones in row 2 and have them in a cell.

The result should be 2 since I want to only compare column A with A, B with B, and not A with B, A with C, etc.

Best Answer

Please try:

=sum(ArrayFormula((A1:Z1>A2:Z2)*1))

and adjust end column reference to suit.

You could instead try =sum(ArrayFormula((1:1>2:2)*1)) but would then limit use of the first two rows of columns AA onwards without risk of erroneous results.