+ Reply to Thread
Results 1 to 7 of 7

Colour cells based on date ranges

  1. #1
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Colour cells based on date ranges

    Hi,

    I would like to know if it's possible to colour cells based on a date range entered in start date and end date cells.

    My spread sheet (attached) has start date and end date cells and to the right of these each column is headed with the w/c date. My requirement is to enter a start date (for example 21/01/2019) and an end date (for example 22/04/2019) and for the cells that correspond to these dates to the right change colour to show a time line of activity.

    Is this possible?

    Was thinking conditional formatting with a formula to indicate the affected cells but unable to get close to the requirement.

    Any help would be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Colour cells based on date ranges

    Try this:

    Highlight F7:BF17 > Conditional Formatting > New Rule > Use a formula
    =AND(F$4>=$D7,F$4<=$E7)
    Format: Fill color of your choice > OK > OK

    You can use the same idea for Compliance Testing and Reactive Maintenance.

  3. #3
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Colour cells based on date ranges

    Perfect, works a treat. Thank you loads.

  4. #4
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Colour cells based on date ranges

    Sorry I have spotted an issue, nothing major, but if you could help again that would be great.

    I’ve just tested a few dates and the only thing I can see is if the project start date is in one of the weeks but is not the start date for that week, the conditional filling fills the next cell along. E.g. D7: 16/01/2019 & E7: 06/03/2019 – H7-O7 should auto-fill however, I7-O7 fill instead.

    Is this easy to resolve?

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Colour cells based on date ranges

    Use this instead:

    =AND(WEEKNUM(F$4,2)>=WEEKNUM($D7,2),WEEKNUM(F$4,2)<=WEEKNUM($E7,2))

    To make the change, you can select any of the Conditional Formatted cells > Conditional Formatting > Manage Rules > Select the rule > Edit Rule > OK > OK

    Thanks for the rep!
    Last edited by 63falcondude; 10-30-2018 at 09:03 AM. Reason: Rep Added

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,296

    Re: Colour cells based on date ranges

    =AND(COUNT($D7:$E7)=2,MEDIAN($D7,$E7,F$4)=F$4)

    Will this formula work better?
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  7. #7
    Registered User
    Join Date
    01-25-2017
    Location
    Worcester
    MS-Off Ver
    2016
    Posts
    93

    Re: Colour cells based on date ranges

    Really appreciate it. Both these solutions work perfectly, amazing effort guys.

+ 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] Change Colour for Blank Cells based on date in another cell
    By LMills77 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-04-2018, 06:33 PM
  2. Highlight cells in calendar based on date ranges in another table
    By ejla in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-20-2017, 02:13 PM
  3. [SOLVED] Colour shapes based on value in cells using named ranges
    By kamazonka in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2015, 07:48 PM
  4. [SOLVED] How do I change the colour of cells based on a start and end date?
    By goodwinluke in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2014, 06:05 AM
  5. formatting cells with quarters based on date ranges
    By nheb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-09-2013, 11:11 AM
  6. Replies: 5
    Last Post: 08-06-2013, 02:13 PM
  7. VBA - If a range of cells do not contain specific text based on date ranges, then error.
    By Carrie_Smattick in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2013, 07:47 PM

Tags for this Thread

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