Populate Leave Calendar

  • Good morning,
    I was hoping to get some guidance here for a Leave calendar I want to create. I have the calendar set up with dates across and the names/IDs down (see attached sample). What I want to do now is, use a report I am getting from the system that shows the start & end date of the leave of a person/ID and have this information populate the calendar with an "x" on the days that fall within the requested leave dates from the report.


    My problem is not getting the individual days populated with the "x" (using >= and<=), what the problem is,
    a) on the report, someone can have multiple requests for leave (eg. 1st May - 5th May and another request from 7th June 15th June), how can I capture all requests of a person (with same ID) and have all requests populated in the calendar
    b) how do I find the values in the report (based on the ID on the calendar) considering that someone can have multiple requests in the report (so vlookup is not an option)


    Hope this is not too confusing.


    Thanks so much for your time and help in the little project.

  • Dear Chirayuw


    thank you for your suggestion, unfortunately that won't work. What I want is the calendar read the dates out of the report and place the x's in the respective days. The report is given from the system and I don't want to modify or format it in anyway. I want Excel to read the info out of it.

  • In Calendar | C5 copied across and down:


    =IF(AND(C$3>=INDEX(Report!$C$1:$C$5,MATCH(Calendar!$A5,Report!$A$1:$A$5,0)),C$3<=INDEX(Report!$D$1:$D$5,MATCH(Calendar!$A5,Report!$A$1:$A$5,0))),"x","")


    Extend the arrays to suit.

  • Was this of any use to you?

    Ali :)


    Enthusiastic self-taught user of MS Excel who's always learning!
    If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

    :!:Forum Rules

  • Dear AliGW
    thank you for your suggestion. Unfortunately I was not yet able to test it on my real file as I have been out of the office. I will check later this week and update you. I truly appreciate your help.

  • That sounds ominous. My guess is that it won’t work because your real file is actually quite different. I’ll watch this space.

    Ali :)


    Enthusiastic self-taught user of MS Excel who's always learning!
    If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

    :!:Forum Rules

  • Dear Ali
    I tested your formula and it is working fine.... except if there are several entries on the report file for the same person. Example, employee 235 has two entries, but only the first one is shown in my calendar, the second one in August does not show. My real file is exactly the same, but can have several entries per year. Any way to show all those entries with your formula??


    Thanks so much for your help.

  • This is why you should provide sample files with properly realistic data.

    Ali :)


    Enthusiastic self-taught user of MS Excel who's always learning!
    If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

    :!:Forum Rules

  • Dear Ali


    my file contains exactly same data as my real one (except far less records). Employee ID 235 is listed in two rows (sorry, one has wrong name, but this shouldn't matter as the formula only looks at the ID), Row 1 & Row 2. But the formula only displays the leave from row 1. The second and any additional row of the same person would not be displayed in the calendar. So if I have an employee with 5 rows (meaning 5 vacation requests), only the first one will be populated. How can I get the additional ones to display?


    Thanks again for your time & assistance.

  • Dear Ali


    thanks so much for the link. Not sure if this can work as it is working with conditional formatting rather than "x". But maybe I can use the formulas in a way that it can work for me too. Anyway, thanks so much for taking the time to assist. Truly appreciate it.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!