+ Reply to Thread
Results 1 to 11 of 11

automatically change the color of a chart according to current period

Hybrid View

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    Helsinki
    MS-Off Ver
    Excel 2010
    Posts
    34

    automatically change the color of a chart according to current period

    I have a chart where on the x-axis I have months as follows P1/12 P2/12 P3/12 P4/12 P5/12 P6/12.. and on the y-axis I have revenues 1000, 2000 etc.

    I have data about the previous months revenues and for rest of the year I fill in manually my forecasts. Now what I want is that the chart draws automatically the bars for my forecasts in different color so that it is easier to see what is actually happened and what are my forecasts. How do I go about it?

    Is there a possibility that I write the last month e.g. P6/12 into one cell and the chart would have a formula to recognize this and from there on the color of the bars would change?

    Thanks,

    Jaakko

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,825

    Re: automatically change the color of a chart according to current period

    Perhaps you can attach a sample workbook, so it would be easier to see what you are trying to achieve.

    Pete

  3. #3
    Registered User
    Join Date
    06-26-2012
    Location
    Helsinki
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: automatically change the color of a chart according to current period

    Excelforumsample.xlsx

    This is a super simple sample of what Im doing.
    The data is coded to fill in the chart with the numbers that have occurred, in this case untill P6/12 from another data source. Meaning the formula recognizes, which month is going on and leaves the rest of the year blank for me to fill in manually with my forecasts (yellow in the chart). So in the bar chart I would need my forecast numbers to be in different color as well like I have now colored them in yellow.

    (I put the current month in one of the cells in the sample. This is because Im already using one cell with the current month to use in one of the formulas in sourcing the data, untill the last occurred month. Maybe this could also be used in the formula to draw the bars from this month onwards.)

    I hope Im being clear enough..

    Thanks for all the help!

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

    Re: automatically change the color of a chart according to current period

    Use 2 series, one for Actual the other for forecast values.
    Set the series overlap to 100.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    06-26-2012
    Location
    Helsinki
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: automatically change the color of a chart according to current period

    Unfortunately the data has to be like it is and I can't add another row. Im creating an excel tool to use for years to come and trying to make everything as automatic as possible, so there is no knowing when somebody is using this and when the numbers should be on the second row anyways..

    thanks for trying though!
    BR,
    Jaakko

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

    Re: automatically change the color of a chart according to current period

    Only other way is via VBA code to format every data point. But you still have the problem of knowing when a user converts a forecast value to an actual value.

  7. #7
    Registered User
    Join Date
    06-26-2012
    Location
    Helsinki
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: automatically change the color of a chart according to current period

    damn.. okay well actually know considering your option I might be able to add the row and do it like you suggested! thanks!

    then just one more thing, if it would be a line graph and not a bar - how do I make the second series start right from where the first series ended? I dont want there to be a line of zeros, which then jumps next to the series one and continues..

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

    Re: automatically change the color of a chart according to current period

    Overlap the last actual value in the forecast data.
    If you are using formula then use NA() rather than "" to suppress data markers and start/finish of lines.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-26-2012
    Location
    Helsinki
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: automatically change the color of a chart according to current period

    excellent!

    now the only problem is that I have a formula in the actualized numbers row in each cell, in the empty cells as well, which are trying to search for the value from the original data. Now the cells look empty for example P7/12 but they have the formula in them. The graph sees them as zeros and draws the line to continue as a zero.

    It would be easy to just erase the formulas but again Im trying to make everything as automatic as possible since I dont know who is going to use this later on..

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

    Re: automatically change the color of a chart according to current period

    As I said,

    If you are using formula then use NA() rather than "" to suppress data markers and start/finish of lines.

  11. #11
    Registered User
    Join Date
    06-26-2012
    Location
    Helsinki
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: automatically change the color of a chart according to current period

    YES! sorry did not quite understand that first!

    You are a saver! thanks you so much!

+ 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