How to count the number of cells that are greater than the cell above each?

DOS

New Member
Joined
Nov 2, 2022
Messages
3
These cells are conditionally formatted to be red if the cell directly above is less than it and green if it's greater than. Each cell contains a simple function of SUM the row to the left plus the cell directly above it.

Screenshot_20221102-195231~2.png

I'm pretty new to Excel so I've been testing functions out, and now I'm trying to count the number of cells that're greater than (or less than) the cell above each cell in this column.

I've tried combining COUNTIF and OFFSET, but I keep getting a return of 0 no matter what.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Excel Formula:
=SUMPRODUCT(--(A1:A9<A2:A10))
 
  • Like
Reactions: DOS
Upvote 0
Solution
Hello,
You can evaluate any Excel function stepwise.
For example, in the formula editor select
Excel Formula:
A1:A9<A2:A10
and press F9. You will get a list of 9 boolean TRUE/FALSE values.
Now select this list together with the surrounding
Excel Formula:
--(...)
and press F9 again. You should get a list of 0/1 values which can finally be summed up by SUMPRODUCT.
Now try SUM instead of SUMPRODUCT.
Regards,
Bernd
 
  • Like
Reactions: DOS
Upvote 0
Hello,
You can evaluate any Excel function stepwise.
For example, in the formula editor select
Excel Formula:
A1:A9<A2:A10
and press F9. You will get a list of 9 boolean TRUE/FALSE values.
Now select this list together with the surrounding
Excel Formula:
--(...)
and press F9 again. You should get a list of 0/1 values which can finally be summed up by SUMPRODUCT.
Now try SUM instead of SUMPRODUCT.
Regards,
Bernd
Ah, I'm on mobile, so I can't do that, thank you though.
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,722
Members
449,465
Latest member
TAKLAM

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top