+ Reply to Thread
Results 1 to 18 of 18

Dynamic charts

  1. #1
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Post Dynamic charts

    Hello))

    I want to create a dynamic chart to analyze the inflation rate of some countries for some years. On my range, I have the dates on the X-axis(B2:G2) and the countries on the Y-axis(A2:A5). I am making a dynamic chart that will auto-update when a new data is added to the range (I am using the combination of OFFSET and COUNTA). Everywhere I looked, there are guides on how to create a dynamic chart which will track the changes if a new column is added (a new date in H2)(I successfully did this). Now I want the dynamic chart to auto-update if a new row is added (a new country in A6).

    Using the table feature to build a dynamic chart is not doing the job either. As far as I understand, the reason is, as my range takes values from another source (I am using index and match for this purpose), the table fails to auto-expand (unless I enter the data manually).

    Are there any ideas how should I proceed?

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Dynamic charts

    Will you please attach a sample Excel workbook? Please don't attach a picture of one.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Dynamic charts

    Change the named range FROM the format

    =OFFSET(Sheet1!$b$2,0,0,COUNTA(Sheet1!$b:$b)-1)

    TO the format:

    =OFFSET(Sheet1!$B$2,0,0,SUMPRODUCT(--(LEN(Sheet1!$B$2:$B$100)>0)))

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Dynamic charts

    Here's a sample...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: Dynamic charts

    Glenn,

    Thank you very much for your answer.

    Here is the problem: I am creating a line chart which will depict each country's inflation change over the year. In your example, instead of Angola, Russia and Pakistan as categories, I want to have Ant, Bat, Cat and Dog.

    William

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Dynamic charts

    Post a sample chart, as requested at post 2.

  7. #7
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: Dynamic charts

    I want my dynamic chart to be like this.
    Attached Files Attached Files

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Dynamic charts

    OK. Try this out for size. select your countries from the Dropdown menu in column A.

    There's a lot going on here. So, if you want me to explain any of the bits, let me know.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: Dynamic charts

    Glenn,

    First of all, thank you very much for your time.

    I will appreciate if you explain me. Just a question-will this technique work if I use INDEX&MATCH formula for column A to automatically return the country names from column P.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Dynamic charts

    You haven't really explained what you want to do, so I can't answer properly. Short answer: try it and see...

  11. #11
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: Dynamic charts

    Here are my questions.

    1.Could you explain how you created the drop-down menu?
    2.In the data source of the line chart, under the Ledend Entries(Series), there is an entry called "blank series". How did you get the chart to ingone the blank series.
    3. I want to do so, that when I add a new country into the column P, it automatically appears in column A and in the line chart. Can I do this without the drop-down menu?

    Thanks a lot

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Dynamic charts

    1. (Modified a bit). I turned your raw data into a Table, and called it Data, by selecting the range and INSERT/Table and renaming it in the box near the top left of the screen. The references to the table will extend automatically as/when you add new rows. Now, if you enter CTRl-F3, it'll take you to the Name Manager. there are two. One is "Data" - the raw data table. the other is "List". It uses a dynamic formula

    =Data!$P$2:INDEX(Data!$P$2:$P$100,COUNTA(Data!$P$2:$P$100))

    which will extend down column P until ir reaches the last entry. Currently (as you can see) it goes down to row 100.

    I used data validation to restrict entries in column A only to items in List (quicker, prevents mis-spelling errors). select any/all of the light pink cells in A2-A7. Data/data validation/data validation. the "source" box tells excl where to look for the acceptable data.


    2. The lookup formula in the beige cells (B2 to J7) returns #N/A when it doesn't find a match. Excel ignores #N/A when plotting charts. However, having a pile of #N/A errors looks ugly. So, i used conditional formatting to make the #N/A text the same beige colour as the cell fill. So they become invisible. Use Home/conditional formatting/manage rules in any of the beige cells to see what was done there. When you select a new country in A, the formula finds a match, returns and plots the data.

    The only way I could think of to create the legend was to restrict the number of countries per graph to a maximum number. i chose 6. I then created 6 text boxes, each one referencing A2, A3, etc, down to A7. I formatted the text COLOUR in those boxes to match the COLOUR of the apprpriate dataset. If no country is selected, the text box remains blank. Once an entry is made in A2, the first text box populates and is automatically formatted to match the dark red colour of the first dataset. Once set up, I just aligned and spaced out the text boxes to look uniform. You can add more lines to allow for more graphs, it will need you to spend some time repeating /extending what I've done; but the legend will very quickly get very complicated and messy.

    3. You can, but if (as now) the list is totally dynamic: there's no need to.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: Dynamic charts

    Glenn,

    I really appreciate your effort. Thank you very much.

    Everythig looks perfect. The only downside is that I may have 20-30 countries, and as you rightly mentioned, generating legends will become complicated and messy. But I will play with it.

    One more question. Could this all be done with VBA?

  14. #14
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: Dynamic charts

    And Can I use iferror formula to have blank cells in B2 to J7, instead of #N/A. Or it would cause a problem?

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Dynamic charts

    Can you use VBA. Yes. But not with me.

    Or it would cause a problem? Yes. Not a HUGE problem, but yes, it will casue a problem. Try it yourself and see what happens.

  16. #16
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: Dynamic charts

    ok, thank you for everything!!

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Dynamic charts

    Great! I'm glad to have helped! If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  18. #18
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: Dynamic charts

    Yes It does for 95%. I will do. Just in case you think of something less complicated regarding the legends, please let me know.

    Have a nice day!!!

+ 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. Dynamic Charts
    By eBopBob in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-19-2014, 11:23 AM
  2. Dynamic Charts
    By tkull in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2013, 06:35 PM
  3. [SOLVED] Dynamic charts
    By devika_1987 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 12-28-2012, 02:59 AM
  4. Dynamic Charts
    By kapilrakh in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-12-2009, 04:57 AM
  5. Make dynamic charts more dynamic
    By Milo in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-12-2006, 04:10 AM
  6. [SOLVED] Dynamic Charts
    By Mark Ivey in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 11-21-2005, 08:25 PM
  7. [SOLVED] Dynamic Charts
    By vrk1 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 09-01-2005, 11:05 AM
  8. Replies: 0
    Last Post: 01-19-2005, 06:34 AM

Tags for this Thread

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