+ Reply to Thread
Results 1 to 8 of 8

Expand chart based on End Date selection

  1. #1
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Expand chart based on End Date selection

    I have a start & end date selection and want to plot a chart based on the date selections - is this possible without VBA? I have attached a test file.
    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,878

    Re: Expand chart based on End Date selection

    You'd use dynamic named range.

    x_axis:
    =OFFSET(Sheet1!$A$1,MATCH(Sheet1!$E$2,Sheet1!$A$1:$A$31,0)-1,,MATCH(Sheet1!$E$3,Sheet1!$A$1:$A$31,0)-MATCH(Sheet1!$E$2,Sheet1!$A$1:$A$31,0)+1)

    Series_data:
    =OFFSET(Sheet1!$A$1,MATCH(Sheet1!$E$2,Sheet1!$A$1:$A$31,0)-1,1,MATCH(Sheet1!$E$3,Sheet1!$A$1:$A$31,0)-MATCH(Sheet1!$E$2,Sheet1!$A$1:$A$31,0)+1)

    Then in Series formula you'd use it like...
    =SERIES(,TestFile.xlsx!x_axis,TestFile.xlsx!Series_data,1)

    See attached.
    Attached Files Attached Files
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Expand chart based on End Date selection

    Thank you very much

  4. #4
    Registered User
    Join Date
    06-16-2017
    Location
    Atlanta
    MS-Off Ver
    2013
    Posts
    21

    Re: Expand chart based on End Date selection

    Can I do something similar to this to do a dynamic calculation instead of adding a dynamic chart? I have 5 rows of data, but will be adding rows each month. Is there a way to calculate return using the first and last values of the dynamic range?

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,878

    Re: Expand chart based on End Date selection

    @Aland2929

    You are welcome. and thanks for the rep.

    @asleischow

    Yes, it's possible. But I suggest you start a new thread with sample workbook attached. As per forum rule #2.

    2. Don't post a question in the thread of another member -- start your own. If you feel it's particularly relevant, provide a link to the other thread. You may include up to 3 links to other URLs in a single post, no more, so only link to the relevant pages.

  6. #6
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Expand chart based on End Date selection

    I understand the offset & match formulas and follow the logic but am struggling to create the effect with my real data.

    1. Created named ranges with correct ranges.
    2. Inserted a blank chart.
    3. Selected "Chart Data Range" with Series_data which creates the chart.

    How do I apply x_axis to my chart?

  7. #7
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,878

    Re: Expand chart based on End Date selection

    I usually create the chart using fixed data range. Then modify series formula.

    Click on the series on chart and in the formula bar. You should see something like below.
    0.JPG

    You can then change series formula to...
    =SERIES(,'File Name.xlsx'!x_axis,'File Name.xlsx'!Series_data,1)

  8. #8
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Expand chart based on End Date selection

    Thanks for your time & effort CK76 - I have managed to apply to my chart correctly!

+ 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. Start Date and End Date selection for chart.
    By DauntlessDS in forum Excel Charting & Pivots
    Replies: 17
    Last Post: 02-09-2015, 05:57 PM
  2. Expand selection and search
    By Excel0ne in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2014, 10:26 AM
  3. Auto Collapse/Expand a Date Pivot table based on current date
    By Dave27 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 06-03-2013, 12:24 PM
  4. Expand and Collapse Date Cells - Gantt Chart
    By hrmason in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-17-2013, 07:55 AM
  5. Auto Expand Table based on Range of Date stated
    By forest06 in forum Excel General
    Replies: 0
    Last Post: 06-27-2012, 01:28 PM
  6. Auto expand range based on first cell selection
    By Jimmy Moggles in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2011, 07:56 AM
  7. Expand selection to add column to the right
    By MnMShow in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-05-2010, 11:10 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