+ Reply to Thread
Results 1 to 5 of 5

Calendar Year. Change colour of date if date between (inclusive) a date interval.

  1. #1
    Registered User
    Join Date
    11-26-2014
    Location
    Portugal
    MS-Off Ver
    Office 2013
    Posts
    3

    Calendar Year. Change colour of date if date between (inclusive) a date interval.

    I have an Excel file with two sheets. One with the full year calendar, and another with a set of records which are selected from a SQL Database table. I want the days in the calendar to change to green colour if that day exists in an inclusive interval of days which are in the second sheet. The initial date is in column D and the final date is in column E. Can someone explain me how to achieve that based on the file attached?

    The file is here:
    https://dl.dropboxusercontent.com/u/...C3%A9rias.xlsx

    or here:
    Mapa de Férias.xlsx
    Last edited by JMPovoa; 11-26-2014 at 12:26 PM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Calendar Year. Change colour of date if date between (inclusive) a date interval.

    Many of our users are unable to view file sharing links due to firewall restriction, so it's always best to create an actual attachment.

    Without seeing your document, I'll make the some assumptions:
    A1 = date in sheet1
    Sheet2!D1:D500 start dates
    Sheet2!E1:E500 end dates

    Conditional Format based on formula for A1

    =SUMPRODUCT((Sheet2!$D$1:$D$500<=A1)*(Sheet2!$E$1:$E$500>=A1))>0

    Copy formatting to other cells.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    11-26-2014
    Location
    Portugal
    MS-Off Ver
    Office 2013
    Posts
    3

    Re: Calendar Year. Change colour of date if date between (inclusive) a date interval.

    I have attached the file in the first post with my most recent edit. Give it a look.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Calendar Year. Change colour of date if date between (inclusive) a date interval.

    This calendar is beautiful.

    I added the formula to B9, and then expanded the ranges to B9:H14, K9:Q14, etc for all months.

    Then I went moved all month<>month formats to the stop, and checked the box "Stop if true" so that gray days don't turn green.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-26-2014
    Location
    Portugal
    MS-Off Ver
    Office 2013
    Posts
    3

    Re: Calendar Year. Change colour of date if date between (inclusive) a date interval.

    Allright, that's exactly what i wanted! Thank you very much. However, i'd like another improvement, if possible, to what you've already done. There's another column name "pestamp" which basically is the ID of each employee. I would like the colour to turn red instead of green if the same vacation day is attributed to more than one employee ID. Then, by clicking that day of the calendar, is there a possible way to see a list of all employees' ID (pestamp) attributed to that day?

    Even if this is not possible, thanks in advance

+ 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] Formula to compare date (including month and year) from a listed date to today's date
    By mhewitson15 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2014, 05:31 PM
  2. [SOLVED] Using SumProduct for dates inclusive of Year to Date, Month to date, Quarter to Date
    By cartica in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2014, 04:22 PM
  3. Replies: 3
    Last Post: 11-27-2013, 05:25 PM
  4. Replies: 11
    Last Post: 07-15-2012, 09:15 AM
  5. Replies: 3
    Last Post: 05-17-2011, 09:44 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