Dynamic Graph when I change date input

randomwalker

Board Regular
Joined
Feb 22, 2007
Messages
169
Hi,

Coulme A are dates starting from 2007/2/1, Column B are the close prices corresponding to the dates in Column A for stock T, Column C are turnovers corresponding to the dates for stock T. I use Excel to plot a graph of which the X axis is date, primary Y axis is stock price and secondly Y axis is the turnover.

cell D1 is the beginning date I input and cell F1 is the ending date I input so that a date range is formed. What I want to achieve is the graph chanes automatically when I change the dates in both D1 and F1.

First, I use functions cell, index and match to find out the reference of the beginning date and the ending date in cell D2 and F2. For example, I input 2007/2/2 in D1, and 2007/2/16 in F1, above combined functions will result $A$2 and $A$12.

In E1, I input =row(indirect(f2))-row(indirect(d2)) to get the # of rows between 2007/2/2 and 2007/2/16.

Go back to the graph, in Source Data..., I tried to change Category (X) axis labels to =offset(indirect(sheet1!D2),0,0,sheet1!E1+1,1). But it doesn't work because Excel pops up an error message.

Then I tried to use the name range with the same formula =offset(indirect(sheet1!d2),0,0,sheet1!E1+1,1). It doesn't work either.

Could any one here help?

Thanks so much in advance!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,214,861
Messages
6,121,969
Members
449,059
Latest member
oculus

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