+ Reply to Thread
Results 1 to 12 of 12

How to apply conditions on charts

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    How to apply conditions on charts

    Hi Guys

    I'm new to using Macros and vba code in Excel and am getting problems in creating dynamic charts. Although I had seen all the posts of condional charts in search forum but no use.
    I have an excel sheet with Date Received Column,Volume Unprocessed and the third column is to add 5 working days in the date received.I have to ask three questions.Please find enclosed the attachment.
    1)In the attachement ,the excelsheet has 4 rows and chart for these values is displayed in chart1. But when new values are added up,it doesn't show those values in the chart automatically and I think I need macro for this.
    2) I want macro to automatically calculate date by adding 5 working days in the date received for the rest of the rows.
    3) If the current date is equal to date in the third column then the bar should be in orange colour. If the current date is greater than the date in 3rd column then the bar should be green colour and if its less then bar should
    be red.
    Could anyone please help me out to solve this.

    Regards
    Aman
    Attached Files Attached Files
    Last edited by aman1234; 03-12-2009 at 08:06 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Problem with charts

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Problem with charts

    No need for code.

    Add 3 columns to perform conditional test.
    Use 3 series in your bar chart based on the 3 columns.
    Format fill colour as required. Set Overlap to 100%

    I have changed the Y axis to be Category rather than time series in order to remove the gaps for days you have no data for.

    I turned the data table into a List object so the chart will automatically exapand to include new rows and the formula will auto populate.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: Problem with charts

    Hi Andy

    Thanks for your help. I have come to know how to change colours in bar chart. But About my 1st and 2nd questions out of 3 ,Can you answer them too. As If I add more records in excel sheet then it does n't show them up in chart.

    Regards
    Aman

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Problem with charts

    Did you try the file I attached? Entering new data will automatically update chart and formula.

    Please amend you question title.

  6. #6
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: How to apply conditions on charts

    Hi Andy
    I have changed the thread title and have also enclosed an attachment that shows ehen I add extra records then the chart doesn't show extra bars for this.
    Please have a look
    Regards
    Aman
    Attached Files Attached Files

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: How to apply conditions on charts

    Because you are not adding information to the list object.

    Select a cell in the range A1:F5 you should notice the big blue border, the automatic dropdown filters and the astrisk for entering of New row.

    If you enter your data there everything will be automatic.

  8. #8
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: How to apply conditions on charts

    Hi Andy

    Sorry as I am new to excel so getting problem in this. Actually data in excelsheet is coming from a userform.As I am working on a project and user when enters the values in the form ,then those values come up in the excel sheet on the basis of ehich the chart should be drawn automatically.

    SO there shouldn't be range limit. As the user can enter 10 or even 100 records at a time.
    I hope you understand my problem.

    Regards
    Aman

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: How to apply conditions on charts

    In that case then maybe using named ranges would be the simplest approach.
    There are many examples of those of the formula.

    You will though need to update the formula used in the 3 columns when updating the sheet.

  10. #10
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: How to apply conditions on charts

    Hi Andy

    As I never used named ranges,Could you please let me know step by step to get the right result.

    Regards
    Aman

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: How to apply conditions on charts

    As I said there are plenty of examples already posted on the forum, use the search.

    There are also plenty of examples here,
    http://peltiertech.com/Excel/Charts/Dynamics.html

  12. #12
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: How to apply conditions on charts

    Andy thanks a lot for your help

+ 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