Create a Dynamic Line Chart for last 4 weeks of data

Wullay

New Member
Joined
Jan 15, 2025
Messages
1
Office Version
  1. Prefer Not To Say
Platform
  1. Windows
Hello,
I have an excel s/sheet which gets populated every day (Monday-Friday) with performance data and then each week an average gets calculated as per the below.

1736947136823.png

From this each week, I need to produce a line chart for each colour's data which shows the last 4 weeks only.

Due to the weekly average getting in the way as such, I have set up a new tab sheet which has a table in it with the same data as above but for Monday-Friday only and have then set up a Dynamic rolling line chart to only show the last 4 weeks using Define Names etc .

1736947449903.png


However, this still means I have to manually update the second sheet table each week with the data as I cannot find a way to automatically get the data which gets entered daily into sheet 1, to update sheet 2. At the moment I have a formula of =Sheet1!C24 for example in cell B3 above but I can't find a way to fill that down the column as I'm going across in one row in Sheet 1. I also have the issue again with the weekly average getting in the way.

My questions are:
1. Using the top table - is there a way to get excel to produce a line chart just using data from Monday-Friday in Sheet 1 and then get this chart to only ever display the last 4 weeks, without creating an additional table.
2. If not, how do I get sheet 2 to automatically populate from sheet 1 and do this from there?

I basically want a chart which gets produced automatically from the data being input daily to show the past 4 weeks data, without having to do any additional work.

Thanks in advance.
 

Attachments

  • 1736947048601.png
    1736947048601.png
    14.1 KB · Views: 2

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Welcome to the Forum!

This is why it's a good idea to keep the data entry area (i.e. daily results) separate from the results area (weekly averages).

If you have access to Excel's FILTER function, you can graph directly from your table:

ABCDEFGHIJKLMNOPQR
1
2TOTALMon 9 DecTue 10 DecWed 11 DecThu 12 DecFri 13 DecTOTALMon 16 DecTue 17 DecWed 18 DecThu 19 DecFri 20 DecTOTALMon 23 DecTue 24 DecWed 25 DecThu 26 DecFri 27 Dec
310.010.09.311.38.77.09.410.19.211.413.914.915.916.815.9
4
5End dateWed 25 Dec
6NoWeeks2
7
Sheet1

Names:
EndDate:
=Sheet1!$B$5
NoWeeks: =Sheet1!$B$6
MyDates: =LET(d,Sheet1!$B$2:$Z$2,FILTER(d,(d<=EndDate)*(d>EndDate-NoWeeks*7)))
MyNumbers: =LET(d,Sheet1!$B$2:$Z$2,n,Sheet1!$B$3:$Z$3,FILTER(n,(d<=EndDate)*(d>EndDate-NoWeeks*7)))

Then in the graph, define

- the "Amount" series values as: =Sheet1!MyNumbers, and
- the Axis labels as: =Sheet1!MyDates

the resulting (dynamic) graph looks like this for the data fields shown:

1737079395714.png
 
Upvote 0
With an older version of Excel, you could set up a table, filter the blank amounts, and graph the table results --> same graph as above.

ABCDEFGHIJKLMNOPQR
1
2TOTALMon 9 DecTue 10 DecWed 11 DecThu 12 DecFri 13 DecTOTALMon 16 DecTue 17 DecWed 18 DecThu 19 DecFri 20 DecTOTALMon 23 DecTue 24 DecWed 25 DecThu 26 DecFri 27 Dec
310.010.09.311.38.77.09.410.19.211.413.914.915.916.815.9
4
5End dateWed 25 Dec
6NoWeeks2
7
8StartCol16
9EndCol5
10
11
12DayDateAmount
131Thu 12 Dec11.3
142Fri 13 Dec8.7
164Mon 16 Dec7.0
175Tue 17 Dec9.4
186Wed 18 Dec10.1
197Thu 19 Dec9.2
208Fri 20 Dec11.4
2210Mon 23 Dec13.9
2311Tue 24 Dec14.9
2412Wed 25 Dec15.9
25
Sheet1
Cell Formulas
RangeFormula
B8B8=MATCH(B5,A2:R2,)
B9B9=B8-B6*6+1
B13:B14,B16:B20,B22:B24B13=INDEX(A$2:R$2,B$9+A13-1)
C13:C14,C16:C20,C22:C24C13=IF(INDEX(A$3:R$3,B$9+A13-1)="","",INDEX(A$3:R$3,B$9+A13-1))
Named Ranges
NameRefers ToCells
EndDate=Sheet1!$B$5B8
NoWeeks=Sheet1!$B$6B9
 
Upvote 0

Forum statistics

Threads
1,225,586
Messages
6,185,832
Members
453,330
Latest member
NAtyNat29

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