COUNTIF for dynamic ranges

daily106

Board Regular
Joined
Dec 20, 2004
Messages
158
I am trying to apply "COUNTIF" according to the dynamic ranges of column(B) and count how many of the same "rates" are applied.

For exmple,

H22 formula is COUNTIF(E22:E24, F22)
H25 formula is COUNTIF(E25:E30, F25)

I do not have to have "yes" or "no", but need some help on vertical countif according to column B. I know how to do this from pivot/subtotal but I need this for VBA. Please advise. Thank you!

EDIT: mod: html deleted as messing with the post. Post only representative snapshots of your data.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

acw

MrExcel MVP
Joined
Feb 13, 2004
Messages
4,814
Hi

When you say VBA, do you want it to enter a formula somewhere, or put a result somewhere. And for the given examples, what should be the result?

Also, should the H25 formula range be 25:30 or 25:29?


Tony
 

daily106

Board Regular
Joined
Dec 20, 2004
Messages
158
thanks Tony,

yes I need the code to count how many rates are listed according to the areas. I know how to do this by formula but I need it in the macro I am creating. the answers that I am looking for are for each areas is there areas with 2 or more same rates?

thank you.
 

Watch MrExcel Video

Forum statistics

Threads
1,133,454
Messages
5,658,868
Members
418,475
Latest member
ExcelBeginner233

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
Top