ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Dynamic source data based on Today (https://www.excelbanter.com/charts-charting-excel/228300-dynamic-source-data-based-today.html)

SPISO

Dynamic source data based on Today
 
I am creating a production barchart that is updated daily. I want the chart
to plot from 3 days old to 4 days in the future. I would like the middle of
the chart to represent today. Tomorrow's data will become today's data when
everything shifts by one at midnight.

I am pretty new to macro so please speak in laymans terms.

Tushar Mehta[_4_]

Dynamic source data based on Today
 
No need for a macro. Adapt the ideas at
Dynamic Charts
http://www.tushar-mehta.com/excel/ne...rts/index.html
particularly example 2
--
Tushar Mehta
http://www.tushar-mehta.com
Custom business solutions leveraging a multi-disciplinary approach
In Excel 2007 double-click to format may not work; right click and select
from the menu


"SPISO" wrote:

I am creating a production barchart that is updated daily. I want the chart
to plot from 3 days old to 4 days in the future. I would like the middle of
the chart to represent today. Tomorrow's data will become today's data when
everything shifts by one at midnight.

I am pretty new to macro so please speak in laymans terms.


SPISO

Dynamic source data based on Today
 
What if there is not any set number of future days in my data table. For
example, some times we have 4 days in the future and other times we have
scheduled 10 days in the future.

I still only want the chart to show Today in the middle, 4 days in the
future, and 3 days in the past in the chart.

"Tushar Mehta" wrote:

No need for a macro. Adapt the ideas at
Dynamic Charts
http://www.tushar-mehta.com/excel/ne...rts/index.html
particularly example 2
--
Tushar Mehta
http://www.tushar-mehta.com
Custom business solutions leveraging a multi-disciplinary approach
In Excel 2007 double-click to format may not work; right click and select
from the menu


"SPISO" wrote:

I am creating a production barchart that is updated daily. I want the chart
to plot from 3 days old to 4 days in the future. I would like the middle of
the chart to represent today. Tomorrow's data will become today's data when
everything shifts by one at midnight.

I am pretty new to macro so please speak in laymans terms.


Tushar Mehta[_4_]

Dynamic source data based on Today
 
Suppose you have the data in cols. A and B with row 1 as the header. Further
suppose you have the 'center date' and the number of past days and number of
future days to show in individual cells named as below.

All the names are sheet-level names.

CenterDate =Sheet1!$D$2
NbrFutureDays =Sheet1!$D$4
NbrPastDays =Sheet1!$D$3

Now, create the 3 named formulas below and plot XVals and YVals as the
x-values and y-values of the series.

AllXVals =OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A:$A)-1,1)
XVals =OFFSET(Sheet1!$A$2,MATCH(Sheet1!CenterDate,Sheet1 !AllXVals,0)-1-Sheet1!NbrPastDays,0,Sheet1!NbrPastDays+Sheet1!Nbr FutureDays+1,1)
YVals =OFFSET(Sheet1!XVals,0,1)

--
Tushar Mehta
http://www.tushar-mehta.com
Custom business solutions leveraging a multi-disciplinary approach
In Excel 2007 double-click to format may not work; right click and select
from the menu


"SPISO" wrote:

What if there is not any set number of future days in my data table. For
example, some times we have 4 days in the future and other times we have
scheduled 10 days in the future.

I still only want the chart to show Today in the middle, 4 days in the
future, and 3 days in the past in the chart.

"Tushar Mehta" wrote:

No need for a macro. Adapt the ideas at
Dynamic Charts
http://www.tushar-mehta.com/excel/ne...rts/index.html
particularly example 2
--
Tushar Mehta
http://www.tushar-mehta.com
Custom business solutions leveraging a multi-disciplinary approach
In Excel 2007 double-click to format may not work; right click and select
from the menu


"SPISO" wrote:

I am creating a production barchart that is updated daily. I want the chart
to plot from 3 days old to 4 days in the future. I would like the middle of
the chart to represent today. Tomorrow's data will become today's data when
everything shifts by one at midnight.

I am pretty new to macro so please speak in laymans terms.



All times are GMT +1. The time now is 11:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com