+ Reply to Thread
Results 1 to 21 of 21

Calendar tracker in different colours

  1. #1
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Calendar tracker in different colours

    Hi all!



    I have an Excel file with two sheets "Calendar" and "Log".

    In the "Log" sheet:

    Cell C3 = Peter
    Cell D3 = 15/01/2024
    Cell C4 = Paul
    Cell D4 = 05/03/2024


    Then, I will be listing more names in column C and will add more dates.


    In the "Calendar" sheet I have the months:

    F4= January
    F5 = February

    And so on until F15 where I have December.

    In the "Calendar" sheet, in the range of cells G4:AK15, I have dates.

    In the "Calendar" sheet, in cell D3, I have a name.

    How do I make Excel highlight the cells in the range G4:AK15 that appear in the "Log" sheet for the name that appears in cell D3 of the "Calendar" sheet? I would like the Holiday in green and the disciplinary in red.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Calendar tracker in different colours

    For Green

    Please Login or Register  to view this content.
    Similar for Red.

    Note: For the last 3 columns of date, I use formula to get the last date of each month automatically. 2024 is leaf year, but your old data did not have day 29.
    Attached Files Attached Files
    Quang PT

  3. #3
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Re: Calendar tracker in different colours

    Hi bebo021999,

    Thanks for your help.

    I have more questions about this:

    Why did you use the formula =DATE(2024,ROWS($4:4),COLUMNS($A:A)) for the dates on the “Calendar” sheet? Did you use it just to get all the days faster rather than typing one by one? Can´t you just put all the dates without the formula?


    What formula would I have to use for the conditional formatting if I added more names to the list and if I added more dates too?


    Many thanks
    Last edited by viewotst; 03-22-2024 at 10:25 AM.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Calendar tracker in different colours

    "Can´t you just put all the dates without the formula?" > Yes
    "What formula would I have to use for the conditional formatting if I added more names to the list and if I added more dates too?"
    1. Convert the range of data on the Log sheet into an Excel table
    2. Define named ranges for each column in the table
    3. For the red conditional formatting rule: =COUNTIFS(Name,$D$3,Dates,G4,Reason,"Disciplinary")
    4. For the green conditional formatting rule: =COUNTIFS(Name,$D$3,Dates,G4,Reason,"Holiday")
    5. To add to tbl_Log select the last cell in the Reason column and press the Tab key
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Re: Calendar tracker in different colours

    Hi JeteMc,

    How are you?

    I apologize for the delay in my reply. I have been away without access to my computer. Thanks for your help.

    Regarding conditional formatting,

    Do I have to select G4 since it’s the first cell in the array G4:AK15 on the Calendar sheet? I assume that selecting another cell wouldn’t work.

    To add to tbl_Log select the last cell in the Reason column and press the Tab key. Do you mean to add an extra row to the table?

    Thanks!

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Calendar tracker in different colours

    "Do I have to select G4 since it’s the first cell in the array G4:AK15 on the Calendar sheet?" > If you want to edit one of the rules, you could either select cell G4 or the whole range G4:AK15
    "To add to tbl_Log select the last cell in the Reason column and press the Tab key. Do you mean to add an extra row to the table?" > Yes

  7. #7
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Re: Calendar tracker in different colours

    Hi JeteMc,

    Once again, many thanks for your help.


    I apologize if most of the questions I am asking are very basic:

    If you want to edit one of the rules, you could either select cell G4 or the whole range G4:AK15. Does this mean that if, for instance, I want to add an additional rule for Sanction. Would I have to follow the steps below?


    1. I would have to select the range G4:AK15, then select conditional formatting (range where I want to apply it)
    2. Put the function below? Ie. G4:AK15 instead of G4?
    Blue conditional formatting rule: =COUNTIFS(Name,$D$3,Dates,G4:AK15,Reason,"Sanction")


    My second question:
    Instead of using COUNTIFS for the conditional formatting, could I use another one like =ISNUMBER(FIND(Dates, Range of dates on the Calendar sheet))? This way, if any of the dates within 'Dates' are found on the Calendar sheet, the ISNUMBER function would return TRUE. Then, select the colour I want the cells to get filled in.

    Many thanks

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Calendar tracker in different colours

    "1. I would have to select the range G4:AK15, then select conditional formatting (range where I want to apply it)" > Correct.
    "2. Put the function below? Ie. G4:AK15 instead of G4?" > You just need to put in G4. Since G4 is a relative reference the formula will evaluate for each cell in the range as if it were a cell formula that had been dragged across and down.
    =COUNTIFS(Name,$D$3,Dates,G4,Reason,"Sanction")
    I don't feel as if =ISNUMBER(FIND(Dates, Range of dates on the Calendar sheet)) will work.
    Try the following instead: =COUNTIFS(Dates,G4)
    Let us know if you have any questions.

  9. #9
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Re: Calendar tracker in different colours

    All clear now!

    Many thanks
    Last edited by AliGW; 04-01-2024 at 03:11 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Calendar tracker in different colours

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

  11. #11
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Re: Calendar tracker in different colours

    Hi JeteMc,

    I hope you are well.


    Sorry, I forgot to ask you a question before clicking on "solved thread".


    Could you please explain the logic behind this function? =COUNTIFS(Name,$D$3,Dates,G4,Reason,"Disciplinary")

    I don't really understand why the COUNTIFS function makes conditional formatting highlighting the cells with the sought dates.

    Many thanks!

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Calendar tracker in different colours

    Excel treats zeros as FALSE and any value other than zero as TRUE.
    If the name in cell D3, and the date in cell G4 match a row on the Log sheet that has "Disciplinary" as a reason then COUNTIFS will yield a value of 1 which is treated as TRUE.
    If the name in cell D3, and the date in cell G4 do not match a row on the Log sheet that has "Disciplinary" as a reason then COUNTIFS will yield a value of 0 which is treated as FALSE.
    Let us know if you have any questions.

  13. #13
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Re: Calendar tracker in different colours

    Thanks, great explanation. Then, Excel will highlight the cells that are TRUE with the colour that we select when using conditional formatting, and the FALSE ones won´t be highlighted. Am I right?

    Regards!

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Calendar tracker in different colours

    That is correct.

  15. #15
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Re: Calendar tracker in different colours

    Thanks again,

    The only thing that I don´t understand.



    With regards to G4 is it because it´s the first cell in the range so the conditional formatting will evaluate all the cells in the range?
    Last edited by viewotst; 04-02-2024 at 03:08 PM.

  16. #16
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Calendar tracker in different colours

    Yes, the red rule is: =COUNTIFS(Name,$D$3,Dates,G4,Reason,"Disciplinary")
    If it were a cell formula and you dragged the fill handle down it would become: =COUNTIFS(Name,$D$3,Dates,G5,Reason,"Disciplinary")
    If it were a cell formula and you dragged the fill handle to the right it would become: =COUNTIFS(Name,$D$3,Dates,H4,Reason,"Disciplinary")
    The same thing happens for each cell in the "Applies to" range because G4 is a relative reference.
    G$4, $G4 or $G$4 would behave differently based on whether the row, column or both were locked.
    Let us know if you have any questions.

  17. #17
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Re: Calendar tracker in different colours

    Thanks again,

    So basically, I have to select the first cell in the range (G4) because if I selected another one, for instance I10, the conditional formatting wouldn't pick the ones before I10 (like I9, H10, G4...)?

  18. #18
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Calendar tracker in different colours

    If you are talking about editing a preexisting rule, then I have found it best to either select the first cell or the entire range.
    Note that the 365 version may operate differently than the 2019 and earlier versions.

  19. #19
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Re: Calendar tracker in different colours

    Quote Originally Posted by JeteMc View Post
    If you are talking about editing a preexisting rule, then I have found it best to either select the first cell or the entire range.
    Note that the 365 version may operate differently than the 2019 and earlier versions.
    No, I was referring to the fact that the criteria2 for all the conditional formatting rules is G4 as it's the first cell within the range for the dates on the calendar sheet. G4 = 01/01/2024

  20. #20
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Calendar tracker in different colours

    Yes, when writing a rule using a formula like those in the file, then start with the first cell in the range.

  21. #21
    Forum Contributor
    Join Date
    04-03-2021
    Location
    Zaragoza
    MS-Off Ver
    2102 MICROSOFT 365
    Posts
    153

    Re: Calendar tracker in different colours

    Quote Originally Posted by JeteMc View Post
    Yes, when writing a rule using a formula like those in the file, then start with the first cell in the range.
    Amazing, thanks a lot for your continuous help!

+ 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. Seniority Vacation Tracker and Calendar
    By rjerand in forum Excel General
    Replies: 6
    Last Post: 10-18-2019, 08:04 AM
  2. Connecting a workload tracker to an excel calendar
    By MTC2016 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-26-2017, 08:52 AM
  3. [SOLVED] how to link holiday tracker & calendar
    By Harry Basra in forum Excel General
    Replies: 22
    Last Post: 01-30-2017, 08:56 AM
  4. [SOLVED] How to link holiday tracker & Calendar
    By Harry Basra in forum Excel General
    Replies: 1
    Last Post: 01-20-2017, 05:23 PM
  5. Replies: 4
    Last Post: 06-14-2016, 10:26 AM
  6. Colours in a Calendar Datepicker in a Floating VBA Userform
    By butterscotch in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2015, 03:32 PM
  7. [SOLVED] School Tracker- how do I average colours
    By kevwilsondj in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-19-2014, 03: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