# CountIf with comparison criteria

Hi,

I have the need to count all numbers in a range where the value in the cell is greater then the cell next to it.

Esentially, for the range a1:z:1
evaluate if a1>a2, count, if not...skip and move move onto
evaluate if b1>b2, count ect.....

Any help is appreciated.
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Do you mean you want to count the number of times a number in row 1 is greater than row 2? If so, try this array formula so use Ctrl+Shift+Enter instead of just enter:

=SUM(IF(A1:Z1>A2:Z2,1))
0
EngineerCommented:
Array formula
=SUM((A1:Z1>A2:Z2)*1)

Non array formula
=SUMPRODUCT((A1:Z1>A2:Z2)*1)
0

Experts Exchange Solution brought to you by