Count Number of Cells in Column B if Cells in Column A are less?

razzandy

Active Member
Joined
Jun 26, 2002
Messages
390
Office Version
  1. 2007
Platform
  1. Windows
Hi Guys

Driving me mad this o_O

Lets say we have a list of numbers in Columns BD and Column BE as below and I want to count how many of the cells in Column BE are greater then the adjacent Cells in Column BD? I have tried Countif and Countifs (=COUNTIF(BE:BE,">"&BD2)) but it counts anything in the column which is above that particular cell i.e cell BE2 or BE3 and so on. I can do a simple =IF(BE2>BD2,1,"") in one Column to return 1's then =COUNT(BJ:BJ) to count the 1's but its just so long winded and I want to be able to use it in VBA with Application.WorksheetFunction.CountIf(). I was really hoping Countif would have worked but I think I have a mental block due to working on it for so long!

1605279771993.png


Thanks in advance and have a great weekend!
 
I rarely use Worksheetfunction in VBA, so not sure why code doesn't work.
No Fluff, I think you have misunderstood me. Your Code is working and implemented into my code so thanks again. (y)
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,215,982
Messages
6,128,104
Members
449,421
Latest member
AussieHobbo

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