+ Reply to Thread
Results 1 to 4 of 4

Chart Between Two Dates

  1. #1
    Registered User
    Join Date
    08-21-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Chart Between Two Dates

    Hi There,

    I have a data series that consists of Dates in column A and values in Column B.

    I would like to be able to put a start date in cell C1 and an end date in Cell c2, and have a graph that would automatically update to only plot the values between these two dates?

    Would anyone have any insight into how this might work? I assume some VBA code might be necessary but happy for a simpler solution if there are any suggestions?

    Regards,

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,758

    Re: Chart Between Two Dates

    There are at least a couple of ways to do this without VBA. You will get better answers if you attach your file (see below).

    One way is to create dynamic named ranges for the values from the desired start to end dates. I have not tested this, would be happy to do so if you provide your file:

    ChartDates:

    =INDEX(Sheet1!A:A,MATCH(Sheet1!C1,Sheet1!A:A,0),1):INDEX(Sheet1!A:A,MATCH(Sheet1!C2,Sheet1!A:A,0),1)

    ChartValues:

    =INDEX(Sheet1!B:B,MATCH(Sheet1!C1,Sheet1!A:A,0),1):INDEX(Sheet1!B:B,MATCH(Sheet1!C2,Sheet1!A:A,0),1)

    Then use ChartDates and ChartValues to define your chart ranges.

    Another way is to use "helper" columns that have formulas to include only the dates you're interested in. Easier to show you in your file than to write out a description.


    The paper clip icon does not work for attachments. Instead, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    08-21-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Chart Between Two Dates

    Hi,

    Thank you so much for your prompt response.

    I will work on the named ranges solution you have suggested, but have had trouble with this approach so far. This would be the preference as I intend on having the dates change with a formula.

    I have attached a sample of the file for you which may help you to explain where i am going wrong!

    Thanks,
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,670

    Re: Chart Between Two Dates

    Another possible solution would be to use a pivot table and pivot chart as modeled on sheet 2 of the attached file. The date filter at the bottom of the pivot chart could be used to determine the dates between which the data would be chosen, as opposed to using cells F3:F4 on sheet 1.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] certain dates in chart
    By andy_tap in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-02-2015, 06:31 AM
  2. Chart Axis in terms of Dates/Other Chart Date Questions
    By jp470519 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-09-2014, 06:27 AM
  3. Replies: 2
    Last Post: 02-13-2014, 06:18 AM
  4. Dates Of Time-Chart Treated As Categories Rather Than Dates
    By RowanB in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 06-11-2013, 07:44 AM
  5. Excel Line Chart - 12 month chart moving with dates
    By rockycj in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-13-2013, 06:41 PM
  6. how do you chart data by dates and omit dates
    By travelbrains in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-09-2008, 02:37 PM
  7. Replies: 1
    Last Post: 09-20-2005, 01:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1