How to conditionally format dates and time in Excel with formulas and inbuilt rules

If you are a regular visitor of this blog, you've probably noticed a few articles covering different aspects of Excel conditional formatting. And now we will leverage this knowledge and create spreadsheets that differentiate between weekdays and weekends, highlight public holidays and display a coming deadline or delay. In other words, we are going to apply Excel conditional formatting to dates.

If you have some basic knowledge of Excel formulas, then you are most likely familiar with some of date and time functions such as NOW, TODAY, DATE, WEEKDAY, etc. In this tutorial, we are going to take this functionality a step further to conditionally format Excel dates in the way you want.

Excel conditional formatting for dates (built-in rules)

Microsoft Excel provides 10 options to format selected cells based on the current date.

  1. To apply the formatting, you simply go to the Home tab > Conditional Formatting > Highlight Cell Rules and select A Date Occurring.
    Excel conditional formatting built-in rules for dates
  2. Select one of the date options from the drop-down list in the left-hand part of the window, ranging from last month to next month.
  3. Finally, choose one of the pre-defined formats or set up your custom format by choosing different options on the Font, Border and Fill tabs. If the Excel standard palette does not suffice, you can always click the More colors… button.
    Choose one of the pre-defined formats or set up your custom format.
  4. Click OK and enjoy the result! : )
    Highlight cells in Excel with dates occurring in the last 7 days.

However, this fast and straightforward way has two significant limitations - 1) it works for selected cells only and 2) the conditional format is always applied based on the current date.

Excel conditional formatting formulas for dates

If you want to highlight cells or entire rows based on a date in another cell, or create rules for greater time intervals (i.e. more than a month from the current date), you will have to create your own conditional formatting rule based on a formula. Below you will find a few examples of my favorite Excel conditional formats for dates.

How to highlight weekends in Excel

Regrettably, Microsoft Excel does not have a built-in calendar similar to Outlook's. Well, let's see how you can create your own automated calendar with quite little effort.

When designing your Excel calendar, you can use the =DATE(year,month,date) function to display the days of the week. Simply enter the year and the month's number somewhere in your spreadsheet and reference those cells in the formula. Of course, you could type the numbers directly in the formula, but this is not a very efficient approach because you would have to adjust the formula for each month.

The screenshot below demonstrates the DATE function in action. I used the formula =DATE($B$2,$B$1,B$4) which is copied across row 5.
Use Excel DATE function to display the days of the week.

Tip. If you want to display only the days of the week like you see in the image above, select the cells with the formula (row 5 in our case), right-click and choose Format Cells…> Number > Custom. From the drop-down list under Type, select either dddd or ddd to show full day names or abbreviated names, respectively.

Your Excel calendar is almost done, and you only need to change the color of weekends. Naturally, you are not going to color the cells manually. We'll have Excel format the weekends automatically by creating a conditional formatting rule based on the WEEKDAY formula.

  1. You start by selecting your Excel calendar where you want to shade the weekends. In our case, it is the range $B$4:$AE$10. Be sure to start the selection with the 1st date column - Colum B in this example.
  2. On the Home tab, click Conditional Formatting menu > New Rule.
  3. Create a new conditional formatting rule based on a formula as explained in the above linked guide.
  4. In the "Format values where this formula is true" box, enter the following WEEKDAY formula that will determine which cells are Saturdays and Sundays: =WEEKDAY(B$5,2)>5
  5. Click the Format… button and set up your custom format by switching between the Font, Border and Fill tabs and playing with different formatting options. When done, click the OK button to preview the rule.
    Excel conditional formatting rule with the WEEKDAY formula to highlight weekends.

Now, let me briefly explain the WEEKDAY(serial_number,[return_type]) formula so that you can quickly adjust it for your own spreadsheets.

  • The serial_number parameter represents the date you are trying to find. You enter a reference to your first cell with a date, B$5 in our case.
  • The [return_type] parameter determines the week type (square brackets imply it is optional). You enter 2 as the return type for a week starting from Monday (1) through Sunday (7). You can find the full list of available return types here.
  • Finally, you write >5 to highlight only Saturdays (6) and Sundays (7).

The screenshot below demonstrates the result in Excel 2013 - the weekends are highlighted in the reddish colour.
The weekends are highlighted in the reddish colour.

Tips:

  • If you have non-standard weekends in your company, e.g. Fridays and Saturdays, then you would need to tweak the formula so that it starts counting from Sunday (1) and highlight days 6 (Friday) and 7 (Saturday) - WEEKDAY(B$5,1)>5.
  • If you are creating a horizontal (landscape) calendar, use a relative column (without $) and absolute row (with $) in a cell reference because you should lock the reference of the row - in the above example it is row 5, so we entered B$5. But if you are designing a calendar in vertical orientation, you should do the opposite, i.e. use an absolute column and relative row, e.g. $B5 as you can see in the screenshot below:

Excel conditional formatting formula to highlight weekends in a vertical orientation calendar.

How to highlight holidays in Excel

To improve your Excel calendar further, you can shade public holidays as well. To do that, you will need to list the holidays you want to highlight in the same or some other spreadsheet.

For example, I've added the following holidays in column A ($A$14:$A$17). Of course, not all of them are real public holidays, but they will do for demonstration purposes : )
Add list of public holidays to a worksheet.

Again, you open Conditional Formatting > New Rule. In the case of holidays, you are going to use either MATCH or COUNTIF function:

  • =COUNTIF($A$14:$A$17,B$5)>0
  • =MATCH(B$5,$A$14:$A$17,0)

Note. If you have chosen a different color for holidays, you need to move the public holiday rule to the top of the rules list via Conditional Formatting > Manage Rules…

The following image shows the result in Excel 2013:
Conditional formatting formula to highlight holidays in Excel.

Conditionally format a cell when a value is changed to a date

It's not a big problem to conditionally format a cell when a date is added to that cell or any other cell in the same row as long as no other value type is allowed. In this case, you could simply use a formula to highlight non-blanks, as described in Excel conditional formulas for blanks and non-blanks. But what if those cells already have some values, e.g. text, and you want to change the background color when text is changed to a date?

The task may sound a bit intricate, but the solution is very simple.

  1. First off, you need to determine the format code of your date. Here are just a few examples:
    • D1: dd-mmm-yy or d-mmm-yy
    • D2: dd-mmm or d-mmm
    • D3: mmm-yy
    • D4: mm/dd/yy or m/d/yy or m/d/yy h:mm

    You can find the complete list of date codes in this article.

  2. Select a column where you want to change the color of cells or the entire table in case you want to highlight rows.
  3. And now create a conditional formatting rule using a formula similar to this one: =CELL("format",$A2)="D1". In the formula, A is the column with dates and D1 is the date format.

    If your table contains dates in 2 or more formats, then use the OR operator, e.g. =OR(cell("format", $A2)="D1", cell("format",$A2)="D2", cell("format", $A2)="D3")

    The screenshot below demonstrates the result of such conditional formatting rule for dates.
    A row is highlighted when text in column C is changed to a date.

How to highlight rows based on a certain date in a certain column

Suppose, you have a large Excel spreadsheet that contains two date columns (B and C). You want to highlight every row that has a certain date, say 13-May-14, in column C.

To apply Excel conditional formatting to a certain date, you need to find its numerical value first. As you probably know, Microsoft Excel stores dates as sequential serial numbers, starting from January 1, 1900. So, 1-Jan-1900 is stored as 1, 2-Jan-1900 is stored as 2… and 13-May-14 as 41772.

To find the date's number, right-click the cell, select Format Cells > Number and choose the General format. Write down the number you see and click Cancel because you do not really want to change the date's format.
Find the numerical value of a date.

That was actually the major part of the work and now you only need to create a conditional formatting rule for the entire table with this very simple formula: =$C2=41772. The formula implies that your table has headers and row 2 is your first row with data.

An alternative way is to use the DATEVALUE formula that converts the date to the number format is which it is stored, e.g. =$C2=DATEVALUE("5/13/2014")

Whichever formula you use, it will have the same effect:
Highlight every row based on a certain date in a certain column.

Conditionally format dates in Excel based on the current date

As you probably know Microsoft Excel provides the TODAY() functions for various calculations based on the current date. Here are just a few examples of how you can use it to conditionally format dates in Excel.

Example 1. Highlight dates equal to, greater than or less than today

To conditionally format cells or entire rows based on today's date, you use the TODAY function as follows:

Equal to today: =$B2=TODAY()

Greater than today: =$B2>TODAY()

Less than today: =$B2<TODAY()

The screenshot below demonstrates the above rules in action. Please note, at the moment of writing TODAY was 12-Jun-2014.
Excel formulas to highlight dates equal to, greater than or less than the current date.

Example 2. Conditionally format dates in Excel based on several conditions

In a similar fashion, you can use the TODAY function in combination with other Excel functions to handle more complex scenarios. For example, you may want your Excel conditional formatting date formula to color the Invoice column when the Delivery Date is equal to or greater than today BUT you want the formatting to disappear when you enter the invoice number.

For this task, you would need an additional column with the following formula (where E is your Delivery column and F the Invoice column):

=IF(E2>=TODAY(),IF(F2="", 1, 0), 0)

If the delivery date is greater than or equal to the current date and there is no number in the Invoice column, the formula returns 1, otherwise it's 0.

After that you create a simple conditional formatting rule for the Invoice column with the formula =$G2=1 where G is your additional column. Of course, you will be able to hide this column later.
Excel conditional formatting rule to highlight blank cells in the Invoice column when the Delivery Date is equal to or greater than today.

Example 3. Highlight upcoming dates and delays

Suppose you have a project schedule in Excel that lists tasks, their start dates and durations. What you want is to have the end date for each task calculated automatically. An additional challenge is that the formula should also consider the weekends. For example, if the starting date is 13-Jun-2014 and the number of days of work (Duration) is 2, the ending date should come as 17-Jun-2014, because 14-Jun and 15-Jun are Saturday and Sunday.

To do this, we will use the WORKDAY.INTL(start_date,days,[weekend],[holidays]) function, more precisely =WORKDAY.INTL(B2,C2,1).
The WORKDAY.INTL formula calculates the End Date for each task taking into account the weekends.

In the formula, we enter 1 as the 3rd parameter since it indicates Saturday and Sunday as holidays. You can use another value if your weekends are different, say, Fri and Sat. The full list of the weekend values is available here. Optionally, you can also use the 4th parameter [holidays], which is a set of dates (range of cells) that should be excluded from the working day calendar.

And finally, you may want to highlight rows depending on how far away the deadline is. For example, the conditional formatting rules based on the following 2 formulas highlight upcoming and recent end dates, respectively:

  • =AND($D2-TODAY()>=0,$D2-TODAY()<=7) - highlight all rows where the End Date (column D) is within the next 7 days. This formula is really handy when it comes to tracking upcoming expiration dates or payments.
  • =AND(TODAY()-$D2>=0,TODAY()-$D2<=7) - highlight all rows where the End Date (column D) is within the last 7 days. You can use this formula to track the latest overdue payments and other delays.

Excel conditional formatting rules to highlight upcoming dates and delays

Here are a few more formula examples that can be applied to the table above:

=$D2<TODAY() - highlights all passed dates (i.e. dates less than the current date). Can be used to format expired subscriptions, overdue payments etc.

=$D2>TODAY() - highlights all future dates (i.e. dates greater than the current date). You can use it to highlight upcoming events.

Of course, there can be infinite variations of the above formulas, depending on your particular task. For instance:

=$D2-TODAY()>=6 - highlights dates that occur in 6 or more days.

=$D2=TODAY()-14 - highlights dates occurring exactly 2 weeks ago.

How to highlight dates within a date range

If you have a long list of dates in your worksheet, you may also want to highlight the cells or rows that fall within a certain date range, i.e. highlight all dates that are between two given dates.

You can fulfil this task using the TODAY() function again. You will just have to construct a little bit more elaborate formulas as demonstrated in the examples below.

Formulas to highlight past dates

  • More than 30 days ago: =TODAY()-$A2>30
  • From 30 to 15 days ago, inclusive: =AND(TODAY()-$A2>=15, TODAY()-$A2<=30)
  • Less than 15 days ago: =AND(TODAY()-$A2>=1, TODAY()-$A2<15)

The current date and any future dates are not colored.
Formulas to highlight past dates in a certain date range

Formulas to highlight future dates

  • Will occur in more than 30 days from now: =$A2-TODAY()>30
  • In 30 to 15 days, inclusive: =AND($A2-TODAY()>=15, $A2-TODAY()<=30)
  • In less than 15 days: =AND($A2-TODAY()>=1, $A2-TODAY()<15)

The current date and any past dates are not colored.
Formulas to highlight future dates in a given date range

How to shade gaps and time intervals

In this last example, we are going to utilize yet another Excel date function - DATEDIF(start_date, end_date, interval). This function calculates the difference between two dates based on the specified interval. It differs from all other functions we've discussed in this tutorial in the way that it lets you ignore months or years and calculate the difference only between days or months, whichever you choose.

Don't see how this could work for you? Think about it in another way… Suppose you have a list of birthdays of your family members and friends. Would you like to know how many days there are until their next birthday? Moreover, how many days exactly are left until your wedding anniversary and other events you wouldn't want to miss? Easily!

The formula you need is this (where A is your Date column):

=DATEDIF(TODAY(), DATE((YEAR(TODAY())+1), MONTH($A2), DAY($A2)), "yd")

The "yd" interval type at the end of the formula is used to ignore years and calculate the difference between the days only. For the full list of available interval types, look here.

Tip. If you happen to forget or misplace that complex formula, you can use this simple one instead: =365-DATEDIF($A2,TODAY(),"yd"). It produces exactly the same results, just remember to replace 365 with 366 in leap years : )

And now let's create an Excel conditional formatting rule to shade different gaps in different colors. In this case, it makes more sense to utilize Excel Color Scales rather than create a separate rule for each period.

The screenshot below demonstrates the result in Excel - a gradient 3-color scale with tints from green to red through yellow.
The 3-color scale shades cells in different colors based on how many days are left until the event.

"Days Until Next Birthday" Excel Web App

We have created this Excel Web App to show you the above formula in action. Just enter your events in 1st column and change the corresponding dates in the 2nd column to experiment with the result.

If you are curious to know how to create such interactive Excel spreadsheets, check out this article on how to make web-based Excel spreadsheets.

Hopefully, at least one of the Excel conditional formats for dates discussed in this article has proven useful to you. If you are looking for a solution to some different task, you are most welcome to post a comment. Thank you for reading!

1237 comments

  1. Hi All

    I really need your help.

    I have an inventory in and out log. It logs date an asset was issued and date it was returned. I have everything in a drop down menu and i need the following. these assets are loaned out on a daily basis and returned on a daily basis. (Or supposed to be) there are other assets issued on a semi permanent basis
    My drop down items on another sheet are (data validation):
    Issued (Conditional Formatting Turns the Cell Yellow if issued is selected)
    Returned (Conditional Formatting turns the cell Green if returned is selected)
    Semi-Permanent (Conditional Formatting turns the cell orange if semi-permanent is selected)
    Lost (turns red when selected)
    Stolen (turns purple when selected)

    If the cell with the date issued is today, the cell containing the selected status "Issued" turns yellow. Issued is a drop down item on another sheet.
    If the cell with the date issued is older than today and the status of the asset still says issued I want the cell to change from yellow fill saying Issued, to Red fill and say "OVERDUE" in bold white. OVERDUE is not a drop down item on another sheet.
    Essentially every night at midnight i want the status of the assent issued.

    Perhaps i should add OVERDUE to the drop down items but im really not sure

    • Hello!
      The value in a cell with a drop-down list cannot be changed automatically. To change the value in a cell to “OVERDUE” according to the conditions, use the IF AND combination. You can change the color of this cell with conditional formatting.

  2. Hi,

    I have a table which contains two columns with dates. I want to highlight in one of the columns the dates that are greater with 3 or more days than the dates în the other column. How can i do this?

    Thank you.

  3. Hello,
    I am trying to create an expense reimbursement sheet for my office.
    I have a date column (to indicate when the expense was incurred), that people will manually fill.
    I would want a "Period" section that automatically fills out depending on those dates.
    i.e. An employee incurred expenses 03/01/2022 and 04/05/22. How can the period section automatically change to "03/01/2022-04/05/2022."?
    Thank you so much!

      • Thank you!
        So I have done that, the issue is that the second "A2" will be changing depending on the number of items, that they will enter, so it sometimes will be A3 or A4, or A5, etc. I have also tried doing a Min Max and concatenate, but I feel I'm missing a part on that second part.

  4. Hello there!

    I am trying to highlight cells using different colors, based on how far away they are, both upcoming and having passed.

    Scenario: I have a deadline for an agreement listed in my spreadsheet. The day is coming up and I would want it to turn yellow when it is 2 weeks away and red when it is one week away or less.

    Scenario 2: I have a date that has passed and I would want it to turn say orange when that date is 3 weeks ago, then red when it is over a month ago.

    I have found things that seem like they should work, using formulas like =TODAY()-C4>30 but I can't seem to make them work.

    Please help. Thank you.

    • Hello!
      Have you tried the ways described in this blog post? Unfortunately, I can't create conditional formatting in your table. If you want to highlight other cells based on the cell with the date, then I recommend that you study this instruction.

  5. (duplicate and corrected)

    I stopped reading at September 2021. Appreciate the time you take to answer the inquiries. Thank you. I couldn't find how to answer my question in some of the replies and am not familiar with Excel or formula use except little by little over time. My question is:

    I have been using the COUNTIF to find specific text within a cell. I am *now trying to do the same with the date, specifically the last 30 days. So within a text, there will be a date followed by a varied comment. I am trying to yellow fill and red annotate that comment for the last 30 days.

    If you can assist, please advise.

    -THANK YOU

    • Hello!
      To find specific text in a cell, it's best to use the SEARCH and FIND functions. Your explanations are not very clear. But to set the background of a date cell with a specific color, use this article's recommendations. However, it is not possible to change the color of only part of a cell.
      If date and comment are written in the same cell, then you need to extract the date from the text: Regex to extract date from string.
      Describe your problem in more detail and maybe I can help.

  6. Hi, i need help to create a conditional formatting rules that automatically highlights that date before 3 months , like if its 14/01/23 it highlights it when 14/11/22 . Can you help me , i did read the tutorial but i dont understand , can you give the simple sample rules.

  7. Hello,

    Used the formula listed in this article:

    =AND(TODAY()-$D2>=0,TODAY()-$D2<=7) - highlight all rows where the End Date (column D) is within the last 7 days. You can use this formula to track the latest overdue payments and other delays. (I changed it to 120 days to see upcoming due dates within the next 4 months)

    But it only highlights the cell, not the row? How do I change it to highlight the row?

    Thank you!

  8. Hello,

    I hope this is easy and straightforward...I have a date column and I'd like to create another date column, but I'd like it to show the date that is 4 months ahead of the first date column. This would be part 1 of my question.

    Part 2 would then be, how can I get the row to change colour, once the date in this new column is going to occur in the next four months?

    Explanation: What I am trying to do is have rows be highlighted when a specific item is coming due within the next four months so that it will be visually flagged.

    Thank you for your time!

  9. hi,

    Im not sure why the following conditional formating formula doesnt work. Cell tresults in the table are references and formulas. No errors are reported when saving but nothing gets highlighted. I was expecting the 5th row (04/05/22 08:47 23/05/22 15:57) to get highlighted

    =AND($G5>NOW(),$H5<NOW())

    Colum G Column H
    Start Date Date Calc
    04/05/22 08:47 04/05/22 08:47
    04/05/22 08:47 04/05/22 08:47
    04/05/22 08:47 04/05/22 08:47
    04/05/22 08:47 04/05/22 08:47
    04/05/22 08:47 23/05/22 15:57
    23/05/22 15:57 02/08/22 23:48
    02/08/22 23:48 13/10/22 07:38
    13/10/22 07:38 23/12/22 15:28
    23/12/22 15:28 04/03/23 23:19
    04/03/23 23:19 15/05/23 07:09
    15/05/23 07:09 10/12/40 16:46

    • ahhhh pls ignore the comment/question. just had the wrong way arround.

  10. Hi There! I've built two sheets in the same workbook: first, a list of teammates, their start date of travel, and the end date of travel. Second, I built a sheet with a calendar similar to yours above with "tasks," but instead it has team members in the first column. I would like the calendar to highlight the dates each team member is traveling referenced from the first sheet. Do you know how I'd do this? Thank you!

  11. TaskAID Associate Start Time Start Time (Mins) End Time (Mins) Duration (secs)
    ab1 1 def1 4/20/22 6:30 6:30:00 AM 6:30:16 AM 16
    ab2 2 def2 4/20/22 6:30 6:30:00 AM 6:30:16.5 AM 16.5
    ab3 3 def3 4/20/22 6:30 6:30:00 AM 6:30:16.2 AM 16.2
    ab4 4 def4 4/20/22 6:30 6:30:00 AM 6:30:18 AM 18
    ab5 5 def5 4/20/22 6:30 6:30 AM 6:30 AM 19
    ab6 6 def6 4/20/22 6:30 6:30 AM 6:30 AM 22
    ab7 7 def7 4/20/22 6:30 6:30 AM 6:30 AM 19.5
    ab8 8 def8 4/20/22 6:30 6:30 AM 6:30 AM 18.7
    ab9 9 def9 4/20/22 6:30 6:30 AM 6:30 AM 15.4
    ab10 10 def10 4/20/22 6:30 6:30 AM 6:30 AM 15.9

    Want to create a stacked bar chart (gantt chart) kind of chart with start time on the x-axis and a line or block starting at time t (start time) and extends till the start time + duration and a gap of time t1 (start time of next task - stop time of previous job by the same individual
    need to plot the same row for multiple individuals who performed multiple tasks

  12. I've been using a 12 month calendar on one of my worksheets in my document. The dates used to "gray" out as the date passed, but for some reason it no longer does this. I didn't create the document and the person who did no longer works here. I don't see any conditional formatting in the worksheet, so I'm not sure how to fix it. Any help would be greatly appreciated.

    • Hi!
      Pay attention to the following paragraph of the article above: Conditionally format dates in Excel based on the current date. Use these recommendations and set the desired color for dates less than the current one.

  13. Hi - I was hoping someone could help.

    I am trying to highlight rows based on months. So... if there was a date between 6/1/22 and 6/30/22, I need it to be a certain color, etc. Different colors for each month. I've read through conditional formatting and do not see how I add a date range.

    Thanks for your help!

  14. Greetings smart people!

    I've tried applying the information gleaned from this article, but I'm having some difficulties.

    I have a "graphics board" that I enter data into daily, wherein outstanding graphic requests are listed containing the Order Date, Due Date, the Approval Date for a given order, and other information.

    What I'm trying to do, is to highlight any rows where the Approval Date (Column G) is equal to or less than 2 days from the Due Date (Column H), not including weekends.

    As a bonus note, I'd ALSO like to automate additional formatting for the "Order Date" field (Column D), where affected rows are further modified if the values are equal to or less than 3 days from the Due Date (again, not counting weekends.) If I can fix the formula for the Approval vs. Due Date argument, I'm sure I could duplicate it for the other two columns.

    Grateful for any help you folks can provide!

    Thank you,

    Miranda

  15. Hello! If I needed to highlight any cell on my worksheet that contained any date, how would I do that?

  16. I have read and looked at this thread and by far it is very detailed and more comprehensive than any other resource out there.
    I have been trying to build conditional formatting formula for a sequence of logical arguments working with 2 columns that have different dates. My table is a blank table that needs filling in.
    I need conditional formatting to highlight the entire row based on logical arguments based on the 2 dates from 2 columns, for instance if one date is earlier than today and the second date from column is an empty cell, to be yellow and the rest of the table not to be formatted. I sort of figured out 2 arguments with and formula and dates on the other column, but I need if possible to create if that particular cell is blank.
    If not how could I link the argument to an additional column that has text as yes it no.
    In conclusion I will need 4 formulas and not sure which one is taking priority and hie to have 4 colours on my table.
    Thank you very much!
    Best regards
    Nico

  17. I'm working on trying to conditionally format 1 column using a 3 color scale based off the dates within those cells. These are all shipping deadlines in, lets call it column C, which is linked to other columns based off of inbound ETA's. The minimum value would be 3 days or less to the date within said cell, midpoint would be 7 to 4 days within said cell and the maximum would be anything greater than 8 days. I've read this post a few times and can't exactly find a situation that I can model a formula off of but more than likely I'm so confused I just don't see or get it. The today function wouldn't work for this because the current date isn't a factor - the cells in question I've just added a formula to tack on 15 days from another date in a separate column which is doing a lookup in a different sheet. Point is the dates are constantly changing so not sure how to set up the formula / what technique to use to format.

    • Hello!
      Create three conditional formatting rules for your conditions separately for each color. All examples are in this article. Instead of the TODAY function, use a reference to your cell with the date. I hope it helps.

  18. So I have a large excel sheet full of training dates expiry's
    I am trying to have it so 3 months before the training expiry the cell goes orange and on the day and after goes and stays red and green if the training is otherwise ?
    could you help please i really really need this would make my life so much handier for work

    • Hi!
      I hope you have studied the recommendations in the tutorial above. Pay attention to the following paragraph – How to highlight dates within a date range. There is an answer to your question. Create a separate conditional formatting rule for each condition.

  19. Good afternoon sir, the situation is like this, on the top it's categorized as per month from January to December, and I have a date and due date on the left side, by subtracting the date and due date, how can I make the difference of date and due date appear on the exact month with conditional formatting?

    • Hi!
      Have you tried the ways described in this blog post? If they don’t work for you, then please describe your task in detail, I’ll try to suggest a solution.

      • Good morning sir from the Philippines.

        Yes sir, the formulas are working but it will take time for me to do that, because I have a series of dates and due dates on the left side, if I drag it all down it will be okay for that certain month, but if I drag the formula to the right since the months starts with January the formula will not work, for the formula is just for January only.

        My worksheet on the left side column A the name of the product, B and C are the dates and due dates respectively, for Columns D onwards are the months starting January to December. What I wanted to do for example, the due date is on January 7 and the date will be January 9 so the difference will be 2 days, making the formula it will pop 2 days under the month of January, but for the other list with other months doesn't fall for the right month with their difference in days.
        That's my problem sir, the differences made from other products list doesn't fall for the right months as the products list with their due dates.

        Thank you for the help in advance.

        Your help is always appreciated...

        • Hello!
          I’m not sure I got you right since the description you provided is not entirely clear. However, it seems to me that the formula below will work for you:

          =IF(MONTH($C2)=COLUMN()-3,$C2-$B2,"")

          Write this formula in D2 and copy it to the right along the row. The MONTH function will determine the desired month.

          • Good morning sir, what I meant to that statement was, the difference of the given date and due date should fall under the months given. For example,
            Due date is January 7, date finished is January 9 their difference is 2 days right, so the 2 days difference should fall under the Month of January.
            But if the next product's due date is February 9, and it finished February 12 their difference would be 3 days and should fall under the month of February.
            The difference of the series of products have different Due Dates that should fall under its respective months.
            My point sir is when I drag the formula down and from left to right, it doesn't go that way, the difference of the day doesn't fall on the exact month. If the due date's on January the difference should fall on January but if it's on April the difference of the day should fall on April too, from the column D - Column O (January to December)

            I will try the method you have given.

            Thank you for the support and it's always appreciated.

  20. Hi, I am trying to highlight dates that are a week from due and then others that are past due. When creating those rules it asks to highlight the cells. Some of the cells are not currently in use but could be added to later, is there a way to only highlight the ones that are in use and the blank cells are white until there is a date entered?

    • Hello!
      Add a condition to the conditional formatting formula that the cell must not be empty. For instance,

      =AND(B1-A1<7,B1<>"")

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)