+ Reply to Thread
Results 1 to 26 of 26

Dynamic Range for Chart Source data

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Dynamic Range for Chart Source data

    I have a single collumn of dates, and another single collumn of data as shown in the help file... the two columns are the source data for a scatter plot which is in another sheet... im trying to set a dynamic range that takes only the last month/30 days and updates the scatter plot so it shows only the last month. I've tried looking this up and I know I need OFFSET and COUNTA. Heres what I have, I'm really confused:

    =OFFSET(Bid List Scatter Plot!$D$10,COUNTA(Bid List Scatter Plot!$D:$D)-30,0,30,1

    can someone please help?
    Attached Files Attached Files

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dynamic Range for Chart Source data

    Could you post a workbook instead of a word file?
    HTH
    Regards, Jeff

  3. #3
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Dynamic Range for Chart Source data

    At first glance, it looks like you are on the right track, but do you realize you are missing a closing parentheses on your equation? As Jeff states, the workbook usually helps.

    Also, it looks like your data starts at D10, but then you ask it to COUNTA for all of column D. If there is anything in D1:D9, those will get counted, too, and likely mess up your offset.

    Pauley
    Last edited by Pauleyb; 06-21-2012 at 09:24 AM.

  4. #4
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    Heres some further clarification:

    fixed the misisng paranthesis

    heres what I have: =OFFSET('Bid List Supply Scatter Plot'!$D$2,COUNTA('Bid List Supply Scatter Plot'!$D:$D)-30,0,30). Do I paste this into x,y values for chart in source data?, thats what I've been trying to do, it either gives me an error or the one time it worked it came up with totally random dates like 1900.

    I've search everywhere I cant understand why it doesnt work

    I posted the original file simplified can someone help?
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Dynamic Range for Chart Source data

    I don't have 2003, and I know some of the dialog boxes have changed. Here is a link that should show you what you need to modify. There are actually two methods, and I usually use the 'dialog box method'.

    http://office.microsoft.com/en-us/ex...001109801.aspx

    Pauley

  6. #6
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    I've seen that link, maybe you can clarify do I need to do -names and define these before hand and add them in series for source data? My understanding was that If I opened source data went to x/y inputs and put in dynamically updating range like this =OFFSET(ScatterPlot!$D$4,COUNTA(ScatterPlot!$D:$D)-30,0,30) it would work. When I try to this it says function invalid.

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dynamic Range for Chart Source data

    Hi vlad23,

    Sorry I got tied up yesterday and couldn't quite finish this up.

    One of the draw backs to what you were attempting to use, what if you have less than 30 which in your case there are two.

    See if this might be an option for you. Instead of 6 or so charts, what about one chart and you cycle the data through it by way of a drop down.

    You'll see all data is in one column so enter new data at the end of the column and then hit the sort button. I think this is a better setup but I know it may not work for you. With the method you had you would have to build twelve different named ranges, but let me say, I couldn't think of a better way.

    Let me know what you think
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    Jeffery, thank you so much for your help. I opened the file and that's exactly the dynamic moving range I need, I do need 6 charts though as its page of a larger weekly report thats printed if you could help me in modifying the current sheet it'd be perect. Thanks again,

    -Vlad

  9. #9
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dynamic Range for Chart Source data

    No problem just give me some time.

  10. #10
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    no problem, much appreciated for the help

  11. #11
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    Just one thing- should I click the sort button?, it gives an error when I do, the chart updates as I add more data so not quite sure.

  12. #12
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dynamic Range for Chart Source data

    Here are the seperate charts but I just built three. Hopefully you can figure the rest.
    Attached Files Attached Files
    Last edited by jeffreybrown; 06-22-2012 at 05:27 PM.

  13. #13
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dynamic Range for Chart Source data

    As far as the sort button, aftering adding new data to the bottom of column A, B, and C, yes select the sort button. Works for me.

    Did you enable macros? Did you download the file to your desktop or did you just open from the thread? I don't think that would make a difference but just asking.

    Is this 2003 you are working with?

  14. #14
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    I downloaded the file and enabled macros it says:

    run time error 438

    object doesnt support this property or method

  15. #15
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dynamic Range for Chart Source data

    And you did not change anything within the file? Anyway, I thought you were going to go with the seperate charts method?

  16. #16
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    I am I was just wondering, ill look into the VBA code. The chart still updates as data is added so no big deal.

  17. #17
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dynamic Range for Chart Source data

    Take a google search for that error number and see what it comes up with. That's what I would have to do because I sure don't know what that code is describing.

  18. #18
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    I'll take a look... what would be the best way to go about having the 6 dynamic charts on one page each pulling data for a set based on rating-AAA,AA etc?

  19. #19
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dynamic Range for Chart Source data

    I'm not quite following that description.

    Are you saying, in one chart have the set of values from (A, AA, and AAA)?

  20. #20
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    Sorry for the confusion -no each in seperate charts like it was before, it should be 6 scatter charts each showing one type.

  21. #21
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    I tried making 6 charts, but I'm unable to. totally lost on this.

  22. #22
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dynamic Range for Chart Source data

    Sorry, I have not had access to this site for the last 6 hours or so.

    I updated the file at post #12

  23. #23
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    I was away from my computer, checked the file today. It was great, thanks again for the help. Much appreciated.

  24. #24
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    Just one more question actually this ones very simple... try to get a dynamic range to take only the last row out of several (only 1 is added at a time) and show 6 entries

    heres the function...

    =OFFSET('Weekly BID LIST SUPPLY'!$Q27:$V$27,0,0,COUNTA( 'Weekly BID LIST SUPPLY'!$Q$27:$V$27),6)

    it targets the right row, theres just something off about it

    any ideas?

  25. #25
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dynamic Range for Chart Source data

    In order to figure this out it is imperative you understand the offset function. You can find info in the Excel Help or even study the named ranges in the attached workbook.

    Here is a scenario which hopefully helps makes sense of the Offset function.

    Let's go with some days of the week in column A sorted A-Z with a total in column B. We are going to sum all values relating to "Tue". (Range >> A1:B9)

    Day Total
    Mon 1
    Mon 2
    Thu 3
    Thu 4
    Tue 5
    Tue 6
    Wed 7
    Wed 8

    =OFFSET(reference,rows,cols,[height],[width]) >> There are 5 arguments to the Offset function, but the last 2 are optional that is why they have [] around them.

    Reference: Where do you want to start? In this case, we'll start in $A$1. Lock it down with absolute references.

    Row: How many rows down from A2 do you have to go to find the first "Tue"? We will use the Match function to find the position from A2 where the first "Tue" starts. MATCH("Tue",$A$2:$A$9,0) >> result is 5

    Cols: In this case we are going to sum column B so we go over 1 column.

    Height: How many "Tue" do we find? We use the Countif function to find out how many "Tue" there are. COUNTIF($A$2:$A$9,"Tue"))) >> result 2

    Width: We are not going to use this so we just leave it off.

    The answer is 11 (5 + 6) and here is how the formula breaks down.

    =SUM(OFFSET($A$1,MATCH("Tue",$A$2:$A$9,0),1,COUNTIF($A$2:$A$9,"Tue")))
    =SUM(OFFSET($A$1,5,1,COUNTIF($A$2:$A$9,"Tue")))
    =SUM(OFFSET($A$1,5,1,2))
    =SUM($B$6:$B$7)
    =11

    In this formula I hard coded "Tue" but you could point to a cell such as D1. Also, Offset will not return anything as a worksheet function so it requires a wrapper function so we use Sum. In the named manager we do not need a wrapper function as Offset can return a range.

    I may have left something out and if so just ask, but my hope is you understand the Offset function enough now to correct the function from your last post.

  26. #26
    Registered User
    Join Date
    06-21-2012
    Location
    new york, ny
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Dynamic Range for Chart Source data

    I do understand, much appreciated again and thanks for the full explanation. It's simple but easy to screw up.

+ 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