+ Reply to Thread
Results 1 to 3 of 3

how to change color of bars in bar chart based on 2nd variable

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    how to change color of bars in bar chart based on 2nd variable

    I have a list of values like these for example (varaible 1):
    1 2 3 2 4 3

    Which are plotted on a bar chart that has green bars. This is the only chart I'm working with.

    I also have a list of corresponding values (variable 2) that goes like this:

    1 -1 -1 0 1 -1

    What I'd like to do is if variable 2 is negative, turn the color of the bar red, if it is positive, leave it green, and if it is 0, make it yellow. So in example above, the lengths of the bars in the chart would correspond to variable 1: 1, 2, 3, 2, 4, 3, and stay in the positive territory of the chart and the colors of the bars would be:

    green red red yellow green red


    How can I do this?

    Thank you for your help.
    Last edited by luv2glyd; 05-30-2010 at 09:50 AM.

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

    Re: how to change color of bars in bar chart based on 2nd variable

    Create a cluster column chart with 3 series and set the overlap to 100.

    The value for each of the 3 series is based on the colour value.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: how to change color of bars in bar chart based on 2nd variable

    Perfect! Thank you. Did not know this kind of chart existed in excel.

+ 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