+ Reply to Thread
Results 1 to 4 of 4

Changing the color of the bars in a Gantt chart based on a value

  1. #1
    Registered User
    Join Date
    08-06-2018
    Location
    Louisiana
    MS-Off Ver
    2013
    Posts
    2

    Unhappy Changing the color of the bars in a Gantt chart based on a value

    Hello!
    I've been struggling for days trying to change the color of the bars in my gantt chart based on the duration category. For example if the duration is 0-30 days, the corresponding bar should be green, 31-59 is yellow, 60+ needs to be red. I've watched youtube videos til my brain is mush but I still can't manage. Can anyone help? Sheet is attached. Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Changing the color of the bars in a Gantt chart based on a value

    Welcome to the forum!

    I think this can be achieved with some helper columns. Created three new columns (one for each time category) and use a formula to show the 'days on air' only in the column for the appropriate number of days. In the attachment, I created the helper columns in G:I and used the following formula in G3:

    =IF(AND($F3>=G$2,OR($F3<=H$2,H$2="")),$F3,"")

    Fill right through I3 and down and you should see the days on air in the appropriate column and blanks everywhere else. For presentation purposes, you can hide these columns if you need a better looking data table, but these new columns are the ones that you will show in your chart using a stacked bar chart. Each 'Spot Name' will get four stacked bars, but you can "white out" the date bar the way you did in your attachment, then two of the numeric bars will be zero (blank), while the other will show the days on air. The most important difference from your current chart is that the visible numeric bars are pulled from three separate columns, so they can be three different colors (red, yellow, green).

    I hope that's not too confusing? Take a look at the attachment to see if that helps:
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  3. #3
    Registered User
    Join Date
    08-06-2018
    Location
    Louisiana
    MS-Off Ver
    2013
    Posts
    2

    Re: Changing the color of the bars in a Gantt chart based on a value

    Thank you so much, I'll play around with the attachment to make sure I understand how it works. Very much appreciated!

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Changing the color of the bars in a Gantt chart based on a value

    Glad to help! Feel free to reply if you're having issues or it's not working properly.

    Good luck!

+ 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. [SOLVED] Automatically color bars in chart based on color in cell
    By D-smoke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2018, 04:10 AM
  2. Dynamically Changing the Color of Bars in the Chart
    By TimeHack11 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-12-2017, 11:25 AM
  3. [SOLVED] Does conditional format apply to bars of a Gantt chart ?
    By adriano.r.marques in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-01-2015, 03:27 PM
  4. [SOLVED] Gantt Chart - Changing cell color based on % completed
    By ktbb0312 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-13-2014, 06:40 PM
  5. Replies: 5
    Last Post: 05-20-2011, 10:00 AM
  6. Shading weekends in Gantt chart bars
    By neobavesten in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-01-2010, 07:34 AM
  7. how to change color of bars in bar chart based on 2nd variable
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2010, 09:49 AM

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