Creating dynamic chart showing last 90 calendar days entries

Ironman

Well-known Member
Joined
Jan 31, 2004
Messages
1,069
Office Version
  1. 365
Platform
  1. Windows
Hello

I have literally rubbed my eyebrows away trying desperately to create a dynamic line chart with columns A, G and H from the below data, so the chart shows only the most recent 90 calendar days entries (NOT the last 90 entries - please let me know if it's necessary to insert a daily entry with a zero value for this to work as I would like).

I've looked in the forum and on the net and I just don't understand if I am able to do this directly from this data or if I have to convert the below to a table with just 3 columns and work from that. However, if I create a separate table I cannot understand how the data would copy from the data sheet below to the table.

After many very late hours trying to work it out it myself I've been on the verge of just giving up and I would be so grateful for a solution that will make this work as it's my exercise bike fitness tracker!

Thank you so much!


Book1
ABCDEFGH
10DATETIME (h:mm)DIST. (km)DIST. (mls)SPEED (mph)LEVELHR BPMPower (W)
11Sat, 6 Jan 20180:3315.29.417.2
12Wed, 10 Jan 20180:4321.213.218.4
13Tue, 16 Jan 20180:4821.213.216.5
14Fri, 19 Jan 20180:5222.213.815.9
15Tue, 23 Jan 20180:5326.316.318.5>100
16Thu, 25 Jan 20180:4621.313.217.3
17Sat, 27 Jan 20180:4520.012.416.6
18Sun, 28 Jan 20180:4620.712.916.8
19Wed, 31 Jan 20180:5023.614.717.6122
20Wed, 14 Feb 20180:4521.013.017.4
21Thu, 22 Feb 20180:4520.913.017.3<120
22Sun, 4 Mar 20180:4521.013.017.4<110
23Tue, 6 Mar 20180:4822.013.717.1111
24Sat, 10 Mar 20180:4720.812.916.5
25Sat, 17 Mar 20181:0125.816.015.8110
26Thu, 12 Apr 20180:4519.312.016.0110
27Mon, 23 Jul 20180:3011.87.314.411090
28Sat, 11 Aug 20180:3013.48.316.6120
29Tue, 25 Sep 20180:3012.47.715.45 (42%)108100
30Wed, 26 Sep 20180:4014.69.113.65 (42%)10795
31Wed, 3 Oct 20180:3012.07.514.95 (42%)113100
32Mon, 8 Oct 20180:3010.96.813.55 (42%)10391
33Sun, 14 Oct 20180:4015.29.414.25 (42%)10795
34Thu, 18 Oct 20180:3512.87.913.65 (42%)12091
35Sun, 21 Oct 20181:0023.214.414.45 (42%)11897
36Wed, 24 Oct 20180:3512.27.613.05 (42%)9587
37Sat, 27 Oct 20180:4518.011.214.95 (42%)10499
38Tue, 30 Oct 20181:0024.515.215.25 (42%)111102
39Fri, 2 Nov 20181:0024.115.015.05 (42%)106100
40Mon, 5 Nov 20181:0024.815.415.45 (42%)105103
41Wed, 7 Nov 20180:4519.111.915.85 (42%)105106
42Fri, 9 Nov 20181:0025.215.615.65 (42%)115102
43Sun, 11 Nov 20181:0026.916.716.75 (42%)111112
44Wed, 14 Nov 20181:0026.416.416.45 (42%)110111
45Mon, 19 Nov 20180:4518.711.615.55 (42%)103104
46Wed, 21 Nov 20181:0026.216.316.35 (42%)108109
47Fri, 23 Nov 20181:0022.814.214.26 (50%)105117
48Sun, 25 Nov 20181:0023.114.314.36 (50%)108118
49Wed, 28 Nov 20181:0223.914.814.46 (50%)105118
50Sat, 1 Dec 20181:0023.614.714.76 (50%)107121
51Tue, 4 Dec 20181:0023.814.814.86 (50%)109122
52Thu, 6 Dec 20181:0022.714.114.16 (50%)110117
53Sat, 8 Dec 20181:0023.414.514.56 (50%)107121
54Mon, 10 Dec 20181:0025.615.915.96 (50%)131131
55Wed, 12 Dec 20181:0024.215.015.06 (50%)110124
56Fri, 14 Dec 20181:0023.314.514.56 (50%)104120
57Mon, 17 Dec 20181:0025.315.715.76 (50%)108130
58Wed, 19 Dec 20181:0024.415.215.26 (50%)108125
59Fri, 21 Dec 20181:0021.513.413.46 (50%)90110
60Sun, 23 Dec 20181:0024.014.914.96 (50%)99123
61Wed, 26 Dec 20181:0023.714.714.76 (50%)94122
62Fri, 28 Dec 20181:0024.915.515.56 (50%)102128
63Sun, 30 Dec 20181:0023.114.314.36 (50%)97119
64Wed, 2 Jan 20191:0021.313.213.26 (50%)90109
65Fri, 4 Jan 20191:0023.614.714.76 (50%)95121
66Sun, 6 Jan 20191:0024.915.515.56 (50%)109128
67Tue, 8 Jan 20191:0023.014.314.36 (50%)89119
68Thu, 10 Jan 20191:0026.716.616.66 (50%)110137
69Sat, 12 Jan 20191:0023.514.614.66 (50%)92121
70Mon, 14 Jan 20191:0025.015.515.56 (50%)101128
Exercise Bike
 
Last edited:
Re: Help with creating dynamic chart showing last 90 calendar days entries please?

Yeah that kept appearing when I saved as the new file name before the merge, there must be some object references library feature on your original sheet that isn't enabled on my excel.

All I can suggest is that you will need to build those 3 sheets into your original file, using my file as reference.

Sorry it has something to do with sndPlaysound32(wavefile, SND_ASYNC Or SND_FILENAME) and other VBA code lines that doesn't agree with my excel version.


When you enter the the array formulas into each column for the Last 90 Tab, have the formula ready in the formula bar and HOLD CTRL+SHIFT then press Enter. When successful the formula will have the curly brackets either end {Formula} which indicates its an array. Then drag the formula down 91 rows like my mock up sheet.
 
Last edited:
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Re: Help with creating dynamic chart showing last 90 calendar days entries please?

Hi RasGhul, I found it too difficult to follow your suggestion I'm afraid, so I'm using your workbook instead.

However, I have just added a new entry to Exercise Bike and it hasn't updated the pivot table/chart even when I refreshed.

The latest workbook is here https://www.dropbox.com/s/d0a7aj233gn35wp/Exercise Log.xlsm?dl=0

I noted that the small pivot table icon in the Exercise Bike sheet (that looks like a bottom right hand corner) hasn't moved from J70 down to the latest row.

I hope renaming the chart didn't cause a problem.

Also, which version of Excel do you have?

I hope you can look at this for me please?

Many thanks again!
 
Last edited:
Upvote 0
Re: Help with creating dynamic chart showing last 90 calendar days entries please?

Hi Mate,

I've re-made the table and tested adding to rows of data and it updated properly after refresh.

Note that the Pivot table values are filtered to only show values greater than zero so we avoid having a blank row in the pivot table and chart.

https://www.dropbox.com/s/b14x46jy4x94grk/Exercise Log.xlsm?dl=0
 
Upvote 0
Re: Help with creating dynamic chart showing last 90 calendar days entries please?

Hi again, thanks for doing that.

I don't know what I'm doing incorrectly but I added a test row of data to Exercise Bike sheet, saved it, right clicked in the pivot table and clicked Refresh and it didn't update.

Here's the file with the added row

https://www.dropbox.com/s/d0a7aj233gn35wp/Exercise Log.xlsm?dl=0
 
Last edited:
Upvote 0
Re: Help with creating dynamic chart showing last 90 calendar days entries please?

Hmm ok what version of excel are you Iron?
 
Upvote 0
Re: Help with creating dynamic chart showing last 90 calendar days entries please?

Hi, it's 2019.

I was just thinking, have a look at the hidden 90R Data sheet that relates to the Last 90 Days Runs dynamic chart - this works without the need for a pivot table but I could never figure out how to replicate it.
 
Last edited:
Upvote 0
Re: Help with creating dynamic chart showing last 90 calendar days entries please?

Thanks RasGhul, will do.
 
Last edited:
Upvote 0
Re: Help with creating dynamic chart showing last 90 calendar days entries please?

Hi again, I just noticed the columns in Exercise Bike tab were too wide for the screen so I missed the bottom right hand corner handle in cell K71 - that column is headed Column 1 - is that the way it should be?

When I entered a new row of data the handle dropped and auto updated - brilliant!

So do I still need to manually refresh the pivot or is there a way for this to be done automatically?
 
Last edited:
Upvote 0
Re: Help with creating dynamic chart showing last 90 calendar days entries please?

You can resize your table by clicking "Exercise Bike A12" above the command ribbon Table Design" will now be available after the Help tab.

Click Design
Left side of Ribbon there is Table Name and Resize Table.
Click Resize Table and a prompt will appear with your Table1 range =$A$10:$K$71
Change to =$A$10:$J$71 (or match same number of rows as your current sheet) then Ok.

You can do the following to update your Pivot but I find it annoying when building sheets but you may find it ok when only entering single rows of data;

Right Click on the Exercise Bike Tab
Click "View Code" - this will open the VBA Editor specifically for this sheet.
On the Left top drop down it currently says General - choose Worksheet
This will automatically appear at the bottom of your Exercise Log - Sheet14 VBA Window "Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub"

Add the following to this code;

thisworkbook.RefreshAll

The end result should look like this;

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ThisWorkbook.RefreshAll
End Sub

Save - then close vba window and done

**be warned as each time you make a change to your sheet it runs the refreshall function
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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