Dynamic Excel Range question

yodachoda

New Member
Joined
May 13, 2015
Messages
3
Hi all,

So let's say my data looks like this:

Date

6/1/2015
6/1/2015
6/1/2015
6/1/2015
6/2/2015
6/2/2015
6/3/2015
6/3/2015
6/3/2015
6/3/2015
6/3/2015
6/3/2015
6/4/2015
6/4/2015

Where the top date is in cell A2 and the last date is in cell A15, in a sheet called "Written".

In a separate sheet within the workbook, I'd like to use a countifs formula for each date, but within the formula rather than defining the range as "Written!A2:A15" I'd like to define it as the starting row for a date to the ending row for a date. So for a countifs for 6/3/2015, I'd like the range to be defined as A7:A12. The reason is I am thinking this will speed up a slow workbook that has many countifs formulas. It's unusable now but I am hoping this will make it fast.

Now it gets a little trickier than that. Rather than manually type or select A7-A12, I'd like for when I drag down the countifs formula (to match descending dates: 6/3/2015 in the top cell, 6/4/2015 in the cell right below, ect), it automatically changes the range to include only the data set for the specific date.

I already have a formula that will give the row # that each date starts and stops at: =MATCH(6/3/2015, Written!A2:A15, 0) gives a result of 7 and =MATCH(6/3/2015+1, Written!A2:A15, 0)-1 gives a result of 12.

I just need for the numbers in the countifs formula range of A7:A12 to link to these match formulas rather than the "normal" way of linking to the Written tab's raw data.

This might seem like alot to do for no purpose but again, with many many countifs formulas and some array formulas, if they each are searching through an entire range, it seems like this is likely the cause of my slowdowns and using limited, automatically shifting ranges will help. Thanks.
 

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.
Maybe use SUMPRODUCT.
Excel Workbook
ABCDEFG
1DateDateCountCount of "a"
26/1/2015a6/1/201543
36/1/2015b6/2/201521
46/1/2015a6/3/201565
56/1/2015a6/4/201521
66/2/2015a
76/2/2015b
86/3/2015a
96/3/2015a
106/3/2015a
116/3/2015b
126/3/2015a
136/3/2015a
146/4/2015a
156/4/2015b
16
Sheet
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,908
Members
448,532
Latest member
9Kimo3

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