+ Reply to Thread
Results 1 to 12 of 12

Gantt type chart using start & end dates with conditional formatting

  1. #1
    Registered User
    Join Date
    11-23-2015
    Location
    Oxford, England
    MS-Off Ver
    2010
    Posts
    54

    Gantt type chart using start & end dates with conditional formatting

    Hi

    I'm trying to produce a Gantt type chart in Excel 2010 to show resourcing over a financial year. (I know they should really be using a project management tool, but they want to use Excel ). I am almost there but have run into difficulties where the end date is mid-month, and also when a task starts and ends in the same month. I've tried several different formulae, but none of them quite work,.

    The formula I am using is as follows:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Again, obviously the text in inverted commas and formatting changes for each task

    I've attached a sample file, does anyone have any ideas where I might be going wrong? I just can't get my head round it at all!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-23-2015
    Location
    Oxford, England
    MS-Off Ver
    2010
    Posts
    54

    Re: Gantt type chart using start & end dates with conditional formatting

    Sorry, there should be a line of text above the second formula which says that the formulae I am using for the conditional formatting is as follows:-

    and then the formula above should follow.

    Not sure what happened there ...

  3. #3
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Gantt type chart using start & end dates with conditional formatting

    Try this to solve your start and end date being in the same month:

    =IF([@[Start Date]]>0,IF(OR(AND([@[Start Date]]<'LookUp Table'!$B$13,[@[End Date]]>'LookUp Table'!$D$12),MONTH([@[Start Date]])=MONTH([@[End Date]])),[@[% time]],""),"")

    I've just checked to make sure you have something in the start date first, then added an OR around your original formula, with a second condition to check if the month is the same in both the start and end dates.

    I'm not clear about what behaviour you expect to see if the start and/or end dates are part way through the month?
    Excel is a constant learning process and it's great to help each other. If any of us have helped you today, a click on the "reputation" star on the left is appreciated.

  4. #4
    Registered User
    Join Date
    11-23-2015
    Location
    Oxford, England
    MS-Off Ver
    2010
    Posts
    54

    Re: Gantt type chart using start & end dates with conditional formatting

    Thanks so much, that looks fabulous, I wouldn't have got there I have to say! I'll try it in the morning on the actual spreadsheet as I have a different version of Excel at home.

    For the mid month end date I'd like the same shading from the conditional formatting as for the full month. I don't expect a partial shading, but something rather than nothing would be amazing!

    Thanks again

  5. #5
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Gantt type chart using start & end dates with conditional formatting

    No problem - glad to have helped.

    It looks like you already have shading in the mid-month end date rows. Check it out and let me know if you get stuck.

  6. #6
    Registered User
    Join Date
    11-23-2015
    Location
    Oxford, England
    MS-Off Ver
    2010
    Posts
    54

    Re: Gantt type chart using start & end dates with conditional formatting

    Hi

    Tried this this morning, but it doesn't seem to work. The mid months aren't being picked up, and the same month isn't either. I must have something wrong but can't see what it is. Are you able to help?

    I've reattached the updated file, so that you can see what I mean.

    Thanks, really appreciate your time.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Gantt type chart using start & end dates with conditional formatting

    Hi,

    Yep, sorry, I can see a couple of things I missed.

    I've added some extra checks into the "current month only" so that it checks against the Lookup Table as well as itself. I've also offset the end date lookup by one row so that it checks the next one up which should solve your "ends in" issue.

    I only updated it in the last four columns in the attached revised version so you'd need to copy it across and adjust the lookup values.

    Fingers crossed
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-23-2015
    Location
    Oxford, England
    MS-Off Ver
    2010
    Posts
    54

    Re: Gantt type chart using start & end dates with conditional formatting

    Me again

    Sorry another query. I've input the new formulae and things seem to work better, but I now have the issue that if the end date is the last day of the month the following month is highlighted! If I change the end date to the penultimate date it works just fine. I've uploaded an actual file (sanitized) so you can see what I mean, as it work just fine in the file that you returned to me, so I am at rather a loss to understand what is now not working. It must be something that I have either done or not done, but I just can't see what.

    Thanks, and again apologies
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Gantt type chart using start & end dates with conditional formatting

    A small tweak should do it...

    Where you currently have

    ,[@[End Date]]>='LookUp Table'!$L$2

    in the second part of the first AND statement, change it to:

    ,[@[End Date]]>'LookUp Table'!$L$2

    In other words, check GREATER THAN instead of GREATER THAN OR EQUAL TO

    I think the problem crept in because I had to change the date it was checking against.

    I downloaded your latest version and tried it on all columns and checked all the end dates and it looks OK to me (famous last words )

    Just one thing to be careful of... the formula is only checking month numbers in some places; as your data only covered 12 months this was fine. If you want to extend the dates over multiple years, you will need to check YEAR numbers AND month numbers.

  10. #10
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Gantt type chart using start & end dates with conditional formatting

    Hello again,

    I got to thinking about that potential problem if you add more than 12 months worth of dates, and came up with an alternative solution.

    This places a helper row on your main Resource Plan sheet which calculates the EOMONTH date for each of your column headings in your table (you can hide this row if it's in the way).

    I've then simplified the formula which drives whether the % Time appears which in turn drives your CF. I changed your last column to April 2017 and the end date on the first row of your data, just to demonstrate that it works.

    The advantages are that you don't need to check your lookup tables for dates, you won't need to adjust the formula in each column (it will always look at the helper cell directly above the column heading) and the solution is more robust if you want to extend beyond 12 months.

    Take a look and see what you think (new version attached)
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-23-2015
    Location
    Oxford, England
    MS-Off Ver
    2010
    Posts
    54

    Re: Gantt type chart using start & end dates with conditional formatting

    Hi

    I just wanted to say a huge thank you for all of you help and also for going the extra mile with this for me. It works beautifully now, and I agree that the helper row is the way to go, it makes it much simpler. I really couldn't have done it without you,I'm immensely grateful.

    I've also learnt a lot from this thread, so even more grateful for that!

    Many, many thanks

  12. #12
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Gantt type chart using start & end dates with conditional formatting

    My pleasure... and thanks for the rep

+ 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. 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
  4. Gantt chart for multiple start and end dates
    By SunRay in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-05-2015, 08:54 PM
  5. [SOLVED] Gantt chart in excel (Formatting from dates)
    By Stndsh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-20-2011, 07:32 PM
  6. Gantt Chart with conditional formatting
    By douglasdale in forum Excel General
    Replies: 2
    Last Post: 06-28-2010, 11:24 AM
  7. Replies: 8
    Last Post: 12-09-2008, 12:38 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