View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Herbert Seidenberg Herbert Seidenberg is offline
external usenet poster
 
Posts: 1,180
Default Rolling Formula based on If

This approach will let you click on the year
that you want and display it on the graph.
Not exactly what you want, but you can probably
tailor it to your needs.
No VBA code required.
Familiarity with defined names helpful.
Assume you have 3 sheets named Y2005 to Y2007
and one named CData.
Each year has named data like this:
Year
2006

Date Val
01/01/06 1
01/02/06 1.63
01/03/06 2.32
01/04/06 2.41
01/05/06 2.70
01/06/06 3.28

On the CData sheet, you have similar data like this:
Name them as shown.

LegendS Spindex
2006 2006

DateS ValS
01/01/06 1.00
01/02/06 1.63
01/03/06 2.32
01/04/06 2.41
01/05/06 2.70

The formulas for LegendS, DateS and ValS a
=INDIRECT("Y"&Spindex&"!Year")
=INDIRECT("Y"&Spindex&"!Date")
=INDIRECT("Y"&Spindex&"!Val")

Plot CData!DateS and CData!ValS
Source Data Name CData!LegendS
While on the chart page, get the Spinner
from the Forms toolbar and place it on the chart.
Right-click the Spinner Format Control Control
Min Value =2005
Max Value = 2007
Cell Link = CData!Spindex
The Spinner will let you go back and forth
between the years and display that year.