Create charts with dynamic ranges

edwardj3

New Member
Joined
Jan 16, 2018
Messages
41
Office Version
  1. 365
Platform
  1. Windows
Hi forum,

Hoping you guys can assist and resolve this issue I've had for a while. Every month I receive data with three columns. Col1 is hourly segments so a maximum number of rows of 672 for 28 days, 696 for 29 days, 720 for a 30 day month and 744 for a 31 day month. There may occasions when a hour segment is missing if there is an issue in collecting the data.

I need to create 5 charts using Col 1 (dd/mm/yyyy hh:mm format with 2 spaces between data and time) and Col2 for each week in the month with each week starting on the Mondays in the month e.g.
week 1 01/08/2019 00:00 to 04/08/2019 23:00 (4 days)
week 2 05/08/2019 00:00 to 11/08/2019 23:00 (7 days)
week 3 12/08/2019 00:00 to 18/08/2019 23:00 (7 days)
week 4 19/08/2019 00:00 to 25/08/2019 23:00 (7 days)
week 5 26/08/2019 00:00 to 31/08/2019 23:00 (6 days)

I need to create another 5 charts using Col 1 and Col3 for each week in the month with each week starting on the Mondays. Ranges as above.

Col1col2Col3
01/08/2019 00:002345343
01/08/2019 01:004355543
01/08/2019 02:004436654
01/08/2019 04:004443456
01/08/2019 05:007557643
01/08/2019 06:004346435
down to
31/08/2019 23:004665469

<tbody>
</tbody>

This data is received monthly so I want to remove the need to hard code the cell ranges required to create the 5 separate charts. How do you add dynamic ranges to create charts? Is there another solution? Is VBA required?

Advice on how I could do this would be appreciated.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
You do not need VBA, you just need to create a chart that has dynamically defined ranges. This is the second time in just over a week that I have seen a question about defining a dynamic range chart where the user or formulas can select the data for the chart. So I wrote up a method to do this and have just published it here: https://www.thinkoutsidetheslide.co...l-chart-with-a-dynamic-range-that-you-select/. I hope that helps you solve this issue.
 
Upvote 0
Dave,
I've applied your solution to my data for 1 week and the dynamic chart works which is fantastic.:biggrin: This will save me quite a bit of time when I need to produce monthly. I can probably also apply this to my other work.
Thank you for the clear and detailed guidance as it will allow others on my team to also follow and utilise.
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,954
Members
448,535
Latest member
alrossman

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