Missing dates for dynamic chart

artz

Well-known Member
Joined
Aug 11, 2002
Messages
830
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have a worksheet with a dynamic chart. I used the named ranges below to do this. There is one problem however with my data. Since the dates are stock data, there are no weekend or holiday dates.

If a StartDate or StopDate is entered for which there is no corresponding date, an error is returned. I think that I have an idea that could work to get around this but I don't know how to implment it.

The idea is that for a StartDate entered that is before the first date or on a weekend or holiday, go to the next available date down the column.

For a StopDate entered that is after the last date or on a weekend or holiday, go to the next available date up the column.

The data are entered in chronologically ascending order with the earliest date in cell A2 but it would be great if the formula worked for dates decending chronologically as well.

Named ranges:
Code:
X values= OFFSET(Chart!$A$2,MATCH(StartDate,ChartDates,0)-1,0,MATCH(EndDate,ChartDates,0)-MATCH(StartDate,ChartDates,0)+1,1)

Y values= OFFSET(Chart!XValues,0,1)

StartDate= Chart!$F$18

EndDate= Chart!$I$18

ChartDates= =Table1[Date]

Does anyone have an idea on how to implement this?

Thanks,

Art
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,203,487
Messages
6,055,713
Members
444,810
Latest member
ExcelMuch

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