+ Reply to Thread
Results 1 to 4 of 4

Highlight cells in calendar based on date ranges in another table

  1. #1
    Registered User
    Join Date
    04-23-2012
    Location
    Split
    MS-Off Ver
    Excel 2010
    Posts
    14

    Highlight cells in calendar based on date ranges in another table

    Dear excel gurus, please, help me.

    I have a table in which each employee has one row, and in it is a calendar with many columns starting from year 2013 till today.
    In another table I have multiple rows for each employee with date ranges when they were not working.
    I need to highlight in red cells in the calendar for each employee, when he was not working.

    Thank you very much.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Highlight cells in calendar based on date ranges in another table

    After selecting B3 in the calendar, use this formula to create your conditional formatting, select the color of your choice.
    =--(MEDIAN(B$2,OFFSET(PODACI!$B$1:$C$1, MATCH($A3, PODACI!$A:$A, 0)-1, , , ))=B$2)

    Also, while B3 is selected you should also click on VIEW > FREEZE PANES > FREEZE. This will lock your headers in row 1 and your IDs in column A so they are always onscreen as you scroll.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Highlight cells in calendar based on date ranges in another table

    Ah, I just noticed you have MULTIPLE entries for each ID in the data sheet. So this wont' work. You would have evaluate EVERY row of the data sheet for every individual cell of your calendar. That's 28k calculations PER CELL on your calendar. There are 3736650 cells in your calendar. That's 104 trillion calculations.

    This is not a formula project. That will kill your workbook. You would need a macro that can go through each cell in your calendar ONE TIME and check the values in your data sheet to determine if the cell should be colored or not.

    Can you explain the value of a sheet as large as your calendar? It cannot be viewed or even reviewed in any efficient manner.

  4. #4
    Registered User
    Join Date
    04-23-2012
    Location
    Split
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Highlight cells in calendar based on date ranges in another table

    Dear Jerry, thank you very much for your reply!
    Your last sentence is what I am asking myself the whole time....but my boss ordered to make it like this, without explaining it.

+ 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] Auto Populate Excel Calendar based on Date Ranges
    By mikearmanios in forum Excel General
    Replies: 14
    Last Post: 04-01-2021, 12:11 PM
  2. [SOLVED] Lookup formla to allocate a calendar date to a week based on a table
    By shrijan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-08-2016, 02:42 AM
  3. [SOLVED] How to count value based on start and end date in calendar table
    By lia86 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 05-10-2016, 05:21 AM
  4. [SOLVED] Highlight Cells based on data in different Table
    By rz6657 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-16-2015, 08:20 PM
  5. [SOLVED] Auto Populate a Linear Calendar Based On A List With Date Ranges
    By falafelologist in forum Excel General
    Replies: 3
    Last Post: 05-20-2015, 08:15 PM
  6. Highlight row based on next date in table
    By kgpetersen in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-19-2014, 01:53 AM
  7. Replies: 10
    Last Post: 10-18-2010, 06:42 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