+ Reply to Thread
Results 1 to 5 of 5

Gantt chart in hours using conditional formatting

  1. #1
    Registered User
    Join Date
    05-17-2016
    Location
    West Sussex
    MS-Off Ver
    Office 2013
    Posts
    3

    Gantt chart in hours using conditional formatting

    Hi all,

    Firstly this is my first post so go easy on me! Secondly, apologies if this is in the wrong section - it does not really fit in charting as I am not using charts to create my "Gantt chart".

    I work in manufacturing and I have created a daily production plan by quarter as a Gantt chart (using conditional formatting) which I have used for a couple of years and has evolved during that time. The problem I am struggling with is that I now want to create a similar plan but by hours, not days. The reason for this is that Production have moved on to an annualised hours work calendar which means they work shorter days in the first part of the year and longer days in the second half. This creates a varying cycle time which I need to account for in my plan.

    I will attempt to attach an example spreadsheet but here is a brief description of how the daily chart works (Plan by Days sheet):
    Columns C to O have start and finish dates for each process (Order release, Pick, Build, Pre-Test, Test, Dispatch, Shipping). All of these dates are automatically populated by the first Build Finish date and take into account working days, holidays etc. The second build finish date is calculated as 1 day after the first build finish date. The idea is that I can change one date (the build finish date) and the whole plan will change. These use the Workday.intl function as Production are currently working a 4 day week.
    Ok, so now I have the start and finish dates for each process, I now want to display that visually so to the right of the dates (P8 to DX54) I have a top row (P7 to DX7) with all the days of the quarter and use a formula in each cell of the "chart" to check if the date matches any of the process start/finish dates in the columns on the left. The cell will display a letter based on this i.e. "P" for Pre-Test. I then use conditional formatting to change the colour of the cell and text depending on it's contents. This then provides a Gantt chart effect using conditional formatting.

    Ok, so here is the problem. I now need to create a similar plan but using hours (Plan by hours sheet), but to further complicate this I want to be able to easily vary the hours or number of days worked depending on the quarter that I am planning. i.e. Q1 needs to have e 4 day week (Mon-Thur) and only 7.5 hours per day but in Q4 we may work 5 day weeks and 10 hour days.
    Specific problems: I want to be able to enter one date and time (Finish Ship Date) and for all other process start/end times to be calculated backwards based on each process cycle time in hours (row 4) and based on 7.5 hour working days over 4 days/week.
    I am struggling with adding/subtracting hours which are over 24 hours.
    Also, was wondering if it is possible to set up some sort of calendar which may simplify the formulas. I will need to be able to change this as the working hours change per quarter.
    I don't have much experience working with time or calendars in Excel.
    I would prefer not to use VBA as I have even less experience in this than in time or calendars!

    Thanks in advance for any help received!
    Mark.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Gantt chart in hours using conditional formatting

    Hi -

    Rather than rebuild your whole gantt chart, why dont you just add a couple of variables that you can change and edit your formulas so they still work in days, but reference cells that convert hours to days. I have attached a copy of your spreadsheet with some simple modifications. For example, the formula in Cell E8 is:

    =WORKDAY.INTL(F8,-5,B2,Holidays!$A$1:$A$30) Where Cell B2 can be edited to be either "0000111" or "0000011" to switch between 4 day or 5 day weeks. Also, I edited the days per process you had in Row 5 to take the divide the estimated hours per process (for example, you had 2 days for Finish Ship, for a 7.5 hour day, that's 15 hours) divided by the number of hours per day (If I change from a 7.5 hour day to a 10 hour day, then the 2 days goes to 1.5 days).

    I'm not sure if this is what you wanted, but it seems a shame to re-invent the wheel when you have something that is 95% there already. I have colored the text of the things I changed to red.

    Hope this helps.
    Attached Files Attached Files
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  3. #3
    Registered User
    Join Date
    05-17-2016
    Location
    West Sussex
    MS-Off Ver
    Office 2013
    Posts
    3

    Re: Gantt chart in hours using conditional formatting

    Thanks for the response.
    I like your solution for the 4 or 5 day week - I couldn't get it to work as a cell reference before but you putting ` in front of the day reference seems to have done the trick!

    Breaking it down into hours as a proportion of a full day does not do what I need though. I have tried this before but the workday function only seems to like integers. For example on a 10 hour day, if the cycle time was set to 19 hours, it counts this as 1 day (as it's less than 2), but if you go to a cycle time of 20 it will count as 2 days. This is why I have been heading down the hours route.

    I think the key question for me to get this to work is to figure out how to count backwards in hours from a starting date and time. I can only get it to work when counting back within the same date.

    Thanks
    Mark.

  4. #4
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Gantt chart in hours using conditional formatting

    Hi -

    Date/Time arithmetic is fairly straight forward. Excel treats dates as an integer. So, the serial number for today is 42508. Excel treats time as a decimal ratio of 24 hours. For example, 8:00 AM is 8/24 = 0.33333. So, to deal with dates AND time together, you simply add the two parts: 42508 + 0.3333 = 42508.333 which, if you use excel formatting will show up as 18-May-2016 8:00 AM. Now it's simply a matter of subtracting the number of hours from that time to get the new date and time. For example, if you subtract 10 hours (10/24=0.41667) from 42508.3333, you get 42507.92, which is 17-May-2016 10:00 PM.

    Now, your problem is calculating working hours, working days (excluding weekends and holidays). Which is a lot of overhead that WORKDAY.INTL takes care of for you.

    Maybe the better solution is to write a formula, or use a table to select the number of working days that a given amount of hours equates to and still use the WORKDAY.INTL to estimate the completion dates. Do you think something along those lines would work for you?

  5. #5
    Registered User
    Join Date
    05-17-2016
    Location
    West Sussex
    MS-Off Ver
    Office 2013
    Posts
    3

    Re: Gantt chart in hours using conditional formatting

    Thanks loginjmor.

    I have played around with using a formula to calculate the hours as a proportion of days but I still hit the problem of the Workday.intl function not working with fractions of days. The formula works but anything over 1 day turns into 2 days so this solution falsely increases my overall cycle time.

    Do you have any suggestions on how to overcome this? I was thinking of writing a formula which looks at the total cycle time in hours and then breaks down each process into a proportion of the total time in days but does not exceed the total, rather than converting each process from hours to days and adding them together which gives the cumulative increase to my total cycle time. My brain has stopped working now and I can't figure out a way of doing it at the moment!

    p.s. How did you format your `0000111 cell in the example spreadsheet as that didn't work in my master sheet? The only way I could get it to work was to format the cell as text rather than general.

+ 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] Conditional Formatting w/ Gantt Chart
    By ormont02 in forum Excel General
    Replies: 10
    Last Post: 02-24-2019, 11:55 PM
  2. Gantt Chart Conditional formatting
    By jsneak in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-30-2015, 07:19 AM
  3. Gantt Chart Conditional Formatting
    By tbrozovich in forum Excel General
    Replies: 6
    Last Post: 06-25-2015, 02:23 PM
  4. Conditional formatting to measure actual vs planned Gantt chart
    By arnab0711 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-19-2015, 04:19 PM
  5. [SOLVED] Gantt Chart Conditional Formatting Issue
    By rgholmes08 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-04-2014, 09:43 AM
  6. Gantt Chart with conditional formatting
    By douglasdale in forum Excel General
    Replies: 2
    Last Post: 06-28-2010, 11:24 AM
  7. [SOLVED] Gantt Chart in Excel. Do I need conditional formatting?
    By Shan in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-15-2005, 09:10 PM

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