# value is greater in a column than corresponsing value in ano

##### New Member
here is the question:

i need to know how many rows exist in which value of A is greater than corresponding value in B.

for example, i have two columns. A and B. Both have numbers:

A|B
----
1|3
2|4
5|4
2|4
2|4

for this example, i m looking for the answer 1 here (as there is only one column in which value of A is greater than corresponding value of B (3rd row)).

regards

### Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi,

Try:

=SUMPRODUCT(--(A1:A10>B1:B10))

i think ur formula is giving me sums of numbers in A whose value is greater than corresponding number in B.

what i need is number of rows in which number in A is greater than corresponding number in B.

regards

Hi,

I have tested the same formula and it works fine for me. The answer after applying the formula based on the example you posted showed as 1

Peace
Wismer

Fairwinds' formula does what you're asking

To return the sum of the values, you'd use =SUMPRODUCT(--(A1:A10>B1:B10),A1:A10)

i was referencing to wrong worksheet within my excel file.

thanks

regards

Replies
8
Views
344
Replies
3
Views
635
Replies
3
Views
314
Replies
1
Views
321
Replies
9
Views
369

1,221,521
Messages
6,160,302
Members
451,637
Latest member
hvp2262

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back