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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,565
Messages
6,114,338
Members
448,570
Latest member
rik81h

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