+ Reply to Thread
Results 1 to 7 of 7

Highlight dates on calendar if between 2 dates

  1. #1
    Registered User
    Join Date
    11-29-2013
    Location
    Pattaya, Thailand
    MS-Off Ver
    Excel 2013
    Posts
    71

    Question Highlight dates on calendar if between 2 dates

    Hello,

    I'm trying to get excel to automatically highlight dates on my calendar that fall between a number of given dates, but this is causing some issues.
    First of all excel doesn't support conditional formatting between dates, and second I can't copy conditional formatting rules to apply to another cell easily.
    It would be possible to manually set up rules for all 365 days of a year, but I was hoping to use a formula that can do this automatically.

    I found a formula that uses median that is quite clever, but I haven't found a way to apply it to a part of the calendar or the entire calendar for that matter.

    This formula does a neat job for a single date, but it would be nice if it would work for an entire month.
    =IF(F5=MEDIAN(F5,Bookings!D3:Bookings!E3),"Yes","No")

    So maybe someone here can help me out with this.

    I attached a version for your convenience to get a better idea.

    Thanks,

    Michael.
    Attached Files Attached Files
    Last edited by vayana; 12-22-2013 at 12:16 PM. Reason: additional info

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,610

    Re: Highlight dates on calendar if between 2 dates

    You make things difficult because the month names are placed in merged cells. This makes it difficult to reference the month for the CF

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Highlight dates on calendar if between 2 dates

    I can't figure out what you want to happen in the posted workbook.
    Can you describe the CF rules you want to employ?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    11-29-2013
    Location
    Pattaya, Thailand
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Highlight dates on calendar if between 2 dates

    I'm more than happy to explain what I want:

    I have rows for each apartment on both sheets, and a calendar for each apartment on the overview sheet (although there's only one in the example I uploaded earlier)
    Now, behind the apartments on the bookings sheet, there are columns with check-in and check out dates. (Currently there's only the first columns of dates filled)

    e.g. if I have a booking for a room that starts on 1-1-2014 and ends 10-1-2014 on the "bookings" sheet, I would like the calendar for that apartment on the "overview" sheet to highlight the days that it's been booked for.

    If I set up a formula for each apartment with its own calendar, I'll have a visual overview of the availability for each apartment on the individual calendars.

    I hope that makes more sense, and as an example I'll upload something that looks like what I would like to happen automatically. For your information: I've just used 1 apartment: La Royale Beach Condo unit 601 to show what I would like to do. The bookings on the booking sheet are highlighted manually on the overview sheet for that apartment.

    I just put the calendars for the other apartment in to clarify that they all have their own availability calendar.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-29-2013
    Location
    Pattaya, Thailand
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Highlight dates on calendar if between 2 dates

    I found this formula in another excel sheet that has a horizontal calendar that highlights events between 2 dates.
    Horizontal meaning:

    The months are in column 1 below each other, the days are filled in behind each month horizontally.

    Now I'm no good in reading formulas, but could someone tell me if this could be applied to my calendar structure as per uploaded previous example?
    The below formula highlights cells in the month January, of which the word January is in merged cell B,C,D 5 and the numbers run from G5 till AK5 (1 -31)

    =OR(AND(E5>=Ya,E5<=Yaa,E5<>"",Ya<>"",Yaa<>""),AND(E5>=Yb,E5<=Ybb,E5<>"",Yb<>"",Ybb<>""),AND(E5>=Yc,E5<=Ycc,E5<>"",Yc<>"",Ycc<>""),AND(E5>=Yd,E5<=Ydd,E5<>"",Yd<>"",Ydd<>""),AND(E5>=Ye,E5<=Yee,E5<>"",Ye<>"",Yee<>""),AND(E5>=Yf,E5<=Yff,E5<>"",Yf<>"",Yff<>""),AND(E5>=Yg,E5<=Ygg,E5<>"",Yg<>"",Ygg<>""),AND(E5>=Yh,E5<=Yhh,E5<>"",Yh<>"",Yhh<>""))

    Thanks,

    Michael.

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Highlight dates on calendar if between 2 dates

    I attached an edited version of your posted workbook.
    I had to base the conditional formatting on helper-columns (to the right of the calendar ranges).
    The helper columns determine if each date is included in one of the rental periods.

    I hope that helps.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-29-2013
    Location
    Pattaya, Thailand
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Highlight dates on calendar if between 2 dates

    Ron,

    Your example works great! thanks for your efforts on this I have been playing with the formula I posted earlier as well, and that does the trick as well so now I have 2 workable solutions. I'll compare the 2 to see which one I'll use in the end and post the result here for your review and for anyone else that is looking for a calendar with highlights.

    I'll mark the thread solved after my comparison and review of the 2, and would like to thank everyone who has spent some time and effort on this!

+ 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] Highlight Group of Dates if Dates Match List of other Dates
    By martinpgibson in forum Excel General
    Replies: 5
    Last Post: 10-24-2012, 08:14 PM
  2. [SOLVED] Auto filling dates based on previously entered dates and averaging numbers if dates equal
    By grambograham in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2012, 03:21 PM
  3. [SOLVED] Highlight dates in a calendar based on event category
    By lopez567 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-02-2012, 08:14 AM
  4. Calendar functions - linking work activities with formatted dates to calendar
    By SKSS in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2012, 06:38 PM
  5. Replies: 0
    Last Post: 03-27-2008, 04:36 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