Choose chart start and end date from drop down

steeful

Board Regular
Joined
Jul 22, 2009
Messages
71
Hello,

I am trying to create a dynamic chart where the user can select the start and end month. I am not sure about how to go about this, but I assume it involves named ranges. Any pointers or tips are greatly appreciated.

Thanks in advance
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Thanks.

I have gotten this far with a code:

=OFFSET('Mstar Data'!$C$2,MATCH(StartDate,ChartDates,0)-1,0,MATCH(EndDate,ChartDates,0)-MATCH(StartDate,ChartDates,0)+1,1)

But unfortunately it only works for dates that are in a column (going down) whereas I need it to work going across a row. How would I go about doing this? The name "ChartDates" has selected all the dates in the row. "StartDate" and "EndDate" are user dropdowns with data validation lists referring to "ChartDates".

Thank you very much!
 
Upvote 0
Okay, I figured out how to get it to do it by row (across) with the following code:

=OFFSET('Mstar Data'!$A$2,13,MATCH(StartDate,ChartDates,0)-1,,MATCH(EndDate,ChartDates,0)-MATCH(StartDate,ChartDates,0)+1)

But it is starting two cells later (in terms of start date, two months) later than the month referenced in the StartDate dropdown. Any ideas? Thanks in advance!
 
Upvote 0
It is difficult to say without knowing the column range for 'ChartDates'.
If you use 'Evaluate Formula' you should be able to see how the formula is working. It will be found on the 'Formulas' TAB if you are using Excel 2007/2010.
 
Upvote 0
The range for "ChartDates" starts at D2 and runs through EA2. I currently have EndDate as Jun'11 (D2) and StartDate as Jan'10 (U2), but the chart is a leaving off Jan'10 and starting at Feb'10 (T2) instead. What am I doing wrong here? Here is the formula (I've been tinkering, trying to get it match the dates):

=OFFSET('Mstar Data'!$B$2,9,MATCH(StartDate,ChartDates,0)+1,,MATCH(EndDate,ChartDates,0)-MATCH(StartDate,ChartDates,0))

Many thanks!
 
Upvote 0
Probably worth checking the 'Refers To' for the name ChartData to ensure that it is starting in D2. You could also check this by selecting the name in the 'Name Box', unless you have that as a dynamic formula.
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,219
Members
452,895
Latest member
BILLING GUY

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