+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting dates based on date range and day

  1. #1
    Forum Contributor
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2007, 2010
    Posts
    167

    Conditional formatting dates based on date range and day

    Hi,

    I have a file I use to track projects, where there is conditional formatting in place to colour a bar of dates to show when projects run from/to. This is the general 'cell value between' formatting. As project days are not always Mon-Sun, I want to include a criteria so that only the days stated are coloured. So if a project runs for the whole month of November, but only Mon-Wed, then only the days of Mon-Wed during November are coloured.

    Attached is a sample file.

    Book2.xlsx

    The days in col A and B are the days from - to. So everthing between and including cell A and cell B are to be coloured.

    The days are reference from another tab, which has to have the days manually written in, and both are formatted as 'general'. I'm wondering if these need to be re-worked/re-formatted to something different to be able to compare correctly...


    Thank you in advance for any time/help
    Last edited by dancing-shadow; 10-30-2013 at 06:48 AM.

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Conditional formatting dates based on date range and day

    Hello
    I've created an example sheet of how I might do this, if I've understood you correctly. It assumes that each project doesn't overlap. If so you'll need to decide which takes priority with the colour formatting. There's also a 'Days' named range for a match criteria with the 'Attendance' days. I haven't put the dates in the formatted cells but you could if you wish.

    Hope it gives you a few ideas.

    DBY
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2007, 2010
    Posts
    167

    Re: Conditional formatting dates based on date range and day

    DBY that's great - your example is exactly what I'm after!

    However... having tried to apply it onto my own file, I can't get it to work... I've attached another file showing exactly where my data sits on the tab (and have amended my own file to match yours, where the date sits in the grey row of cells, rather than in each cell as I had before). I'm wondering if having merged cells is creating a problem, or whether I'm doing something wrong.

    Copy of Book3.xlsx

    EDIT: Scrap that - just realised your 'Days' is a named range. I've added this in and now it workes perfectly! Thank you again for your help.
    Last edited by dancing-shadow; 10-30-2013 at 06:47 AM.

  4. #4
    Forum Contributor
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2007, 2010
    Posts
    167

    Re: Conditional formatting dates based on date range and day

    I have a follow-up query regarding this file, as I've found a problem with it.


    If I have a problem running within a week, eg. Mon to Thurs, this equates to day 1 to day 4, and works fine.

    However if I have a project running from one week to the next, eg. Fri to Tues, this equates to day 5 to day 2, and therefore doesn't work as the day numbers are not incremental.

    How do I alter the formula to incorporate the two types I have?

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Conditional formatting dates based on date range and day

    You have already marked it as solved, so its less likely to be visible to others. Its better you open up a new thread and link back to this thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Conditional Formatting Cells with Dates Outside of Date Range
    By emalegria in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-18-2013, 04:09 PM
  2. [SOLVED] Conditional formatting based on dates in a range of cells
    By pmerobertson in forum Excel General
    Replies: 8
    Last Post: 01-10-2013, 12:50 PM
  3. Replies: 8
    Last Post: 11-15-2011, 12:29 PM
  4. Conditional formatting of one cell based on date range of another cell
    By raggatip in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 08-02-2010, 02:11 AM
  5. Conditional formatting based on date range
    By RGB in forum Excel General
    Replies: 3
    Last Post: 05-23-2006, 12:45 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