+ Reply to Thread
Results 1 to 5 of 5

Automatically select data between two dates

Hybrid View

  1. #1
    Registered User
    Join Date
    03-22-2011
    Location
    ontario, canada
    MS-Off Ver
    Excel 2003
    Posts
    27

    Question Automatically select data between two dates

    I have created several charts that uses stacked columns and a line graph from 5 data sets.(4 for the columns and 1 for the line)

    my problem is that new data is added every week and i only want data graphed for the past quarter year (January-March / April-June / July-Sept / Oct-Nov). So basically once january, april, july, or october comes i want the chart to automatically move the data selection from the first week of the quarter to the final week entered.

    i was thinking about using dynamic charts but i couldn't get them to work properly. not sure if they are advanced enough to do the task.

    is there a simple way to make a macro or to program vba to do this? i have worked with some vba but not with charts. Any help would be appreciated.

    thanks
    -Adam
    Last edited by asinger; 03-23-2011 at 02:10 PM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Automatically select data between two dates

    Hi,

    The attached file plots a chart between two dates specified in cells E1 and E2. I think this should get you started.
    Attached Files Attached Files
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    03-22-2011
    Location
    ontario, canada
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Automatically select data between two dates

    Quote Originally Posted by sweep View Post
    Hi,

    The attached file plots a chart between two dates specified in cells E1 and E2. I think this should get you started.
    that will work perfectly! except i cant seem to figure out how you did it.

    could you give me a rough explanation?

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Automatically select data between two dates

    Sure.

    If you take a look in the names editor (CTRL & F3) you will see two named ranges.

    Dates refers to

    =INDEX(Sheet1!$A$1:$A$20000,MATCH(Sheet1!$E$1,Sheet1!$A$1:$A$20000,0)):INDEX(Sheet1!$A$2:$A$20000,MATCH(Sheet1!$E$2,Sheet1!$A$1:$A$20000,0))

    a range between the "start" date in E2 is found in column A and the "finish" date found in column B


    Data uses offset to define the data alongside the dates named range.

  5. #5
    Registered User
    Join Date
    03-22-2011
    Location
    ontario, canada
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Automatically select data between two dates

    Quote Originally Posted by sweep View Post
    Sure.

    If you take a look in the names editor (CTRL & F3) you will see two named ranges.

    Dates refers to

    =INDEX(Sheet1!$A$1:$A$20000,MATCH(Sheet1!$E$1,Sheet1!$A$1:$A$20000,0)):INDEX(Sheet1!$A$2:$A$20000,MATCH(Sheet1!$E$2,Sheet1!$A$1:$A$20000,0))

    a range between the "start" date in E2 is found in column A and the "finish" date found in column B


    Data uses offset to define the data alongside the dates named range.
    Awesome, works great! thanks so much

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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