Major Macro Issue

xyz1010

New Member
Joined
Jul 11, 2011
Messages
6
So this is my problem. I have a "Sales Price" column in my worksheet. My task is to count the number of sales prices that fall between three categories(Less than 500k, between 500K and 1M, and finally greater than or equal to 1M). Initially I was using the COUNTIF function but I'm trying to get a macro for this because I have to do this stuff over and over!

The other thing that should be taken into consideration is that since I'm getting this data from some database, my rows are constantly changing. Therefore whatever macros I get should incorporate the fact that my rows are changing
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You can use the countif. If they are all in the same column just set the range as the whole column and you never need to write the function again.

=COUNTIF(A:A,">20")

that could count everything in column A, top the bottom that is over 20.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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