+ Reply to Thread
Results 1 to 15 of 15

Automatically updated chats x values

  1. #1
    Registered User
    Join Date
    11-18-2008
    Location
    Pretoria
    Posts
    11

    Automatically updated chats x values

    Hi

    My problem: I have a lot of charts in one file. I have to update each one of them every month after i added monthly data.
    Can the chart be changed so it automatically changes its range to include added data?

    help will be appreciated.

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Automatically updated chats x values

    Yes, This is easily done with 'dynamic ranges'. The internet (and this forum) is full of these formula's. They all look like:
    =OFFSET($A$1,0,0,COUNTA(A:A),1) when there is no header and
    =OFFSET($A$2,0,0,COUNTA(A:A)-1,1) when there is a header.

    Can you adjust this for your data? If not please add a workbook and w'll do it for you.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Registered User
    Join Date
    11-18-2008
    Location
    Pretoria
    Posts
    11
    I can unfortunately not upload my worksheet, its huge.

    But I've attached a document with similar data

    As i put in data in the worksheet i want the graph to automatically adjust its x-range.

    Thanks
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671
    Define two names:
    XLABELS=OFFSET(Sheet1!$A$5,0,0,1,COUNTA(Sheet1!$6:$6))
    VALUES=OFFSET(Sheet1!$A$6,0,0,1,COUNTA(Sheet1!$6:$6))
    Make a clustered column graph. Select one of the bars. You'll see this appear
    =SERIES(,Sheet1!$A$5:$M$5,Sheet1!$A$6:$M$6,1). Change this into
    =SERIES(,example.xls!XLABELS,example.xls!VALUES,1)

  5. #5
    Registered User
    Join Date
    11-18-2008
    Location
    Pretoria
    Posts
    11
    Ill rather get someone to do this, i dont have a clue how to do those things you talk about. thanks anyway.

  6. #6
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Automatically updated chats x values

    What version of excel are you using? Please give it a go. It's not hard and this forum is for you to 'learn'. This is when you have Excel 2003:

    Select A5:M6
    Make a graph by Insert Chart, Column, Chart sub type: clustered column graph. Press Finish and the graph will appear.

    Now we will define names:
    Insert -> Name -> Define
    XLABELS, refers to =OFFSET(Sheet1!$A$5,0,0,1,COUNTA(Sheet1!$6:$6)) Press OK
    Insert -> Name -> Define
    VALUES, refers to =OFFSET(Sheet1!$A$6,0,0,1,COUNTA(Sheet1!$6:$6)) Press OK

    Press one of the bars in the graph and you'll see this: =SERIES(,Sheet1!$A$5:$M$5,Sheet1!$A$6:$M$6,1)
    replace this with =SERIES(,example.xls!XLABELS,example.xls!VALUES,1)

    Succes, another day lived, another day learned

  7. #7
    Registered User
    Join Date
    11-18-2008
    Location
    Pretoria
    Posts
    11
    thanks a LOT!!! It worked. Now i must just try it on my "real" worksheet

  8. #8
    Registered User
    Join Date
    11-18-2008
    Location
    Pretoria
    Posts
    11
    i have a lot of graphs on my worksheet, can i make use of different names for each and use the offset to just count from the one?

  9. #9
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Automatically updated chats x values

    If the number of VALUES is equal for ALL, then yes.

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,438
    It's not clear from your example but if you wanted to plot data from row 7 and the labels remain in row 5 you can use this,

    =OFFSET(XLABELS,2)

    to create new named ranges as rwgrietveld has described.
    Cheers
    Andy
    www.andypope.info

  11. #11
    Registered User
    Join Date
    11-18-2008
    Location
    Pretoria
    Posts
    11
    Quote Originally Posted by rwgrietveld View Post
    If the number of VALUES is equal for ALL, then yes.
    Yeah it is. Jan, Feb... with different data i want to plot per month, just another quick question. If i want to start with colom "B" do i just start with the reference in "B" and subtract 1 from the COUNTA value?

  12. #12
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,438
    Either use the offset argument

    =OFFSET(Sheet1!$A$5,0,1,1,COUNTA(Sheet1!$6:$6)-1)

    or adjust anchor reference

    =OFFSET(Sheet1!$B$5,0,0,1,COUNTA(Sheet1!$6:$6)-1)

  13. #13
    Registered User
    Join Date
    11-18-2008
    Location
    Pretoria
    Posts
    11

    Smile

    Quote Originally Posted by Andy Pope View Post
    Either use the offset argument

    =OFFSET(Sheet1!$A$5,0,1,1,COUNTA(Sheet1!$6:$6)-1)

    or adjust anchor reference

    =OFFSET(Sheet1!$B$5,0,0,1,COUNTA(Sheet1!$6:$6)-1)
    thanks, i must play around with this...

  14. #14
    Registered User
    Join Date
    11-18-2008
    Location
    Pretoria
    Posts
    11
    I did this, the offset "range" changes when i look in the "XVALUES" defined name, but the chart does not update... Ive looked over and over but i cant find the fault...

  15. #15
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,438
    you will need to post your revised file is others are to see the problem

+ 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