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

See how to apply Excel conditional formatting to dates. Learn how to use formulas to highlight weekends and holidays, format cells when a value is changed to a date, shade upcoming dates and delays, conditionally format dates based on the current date, and more. Continue reading

Comments page 18. Total comments: 1245

  1. Hi;
    I hope someone can help me on an attendance sheet which there are 31 columns for 31 days in a month (ex: january).
    I want to know if columns that contain " Sat" and " Sun" or " Holiday" will be locked and no entries allowed.

    Which formula or conditional format or VBA to use that command. Thanks

  2. Thanks you for details formatting concept explained.

  3. =AND(TODAY()>=$E$2,TODAY()30 days from target AND <the target date. (dates in serial format in my case).

  4. Dear all,

    I would like to highlight the dates of the contracts that will end up in the future 90 days... But I don't know how to do it. I have tried so many things but nothing seems to work.

    Can you please help me to fix that?

    Best

  5. I am trying to change a color code in column A based on the date in column E. Currently I am only able to apply the change of color in column E itself but I would need to change the different colors in column A based on a booking system so I basically like to reset all cells in column A with the color blue and orange to color green every single day to show that they are available to be booked again. Is there any way to do this?? Any thoughts much appreciated!

  6. I am using the following formula:
    =IF(L15="","",IF(ISNA(L15),NA(),L15-TODAY()&" Days Remaining"))
    to determine how many days remaining until the next service of plant & equipment (working on a 6 monthly cycle)
    And then when applying conditional formatting I am using:
    When Cell Value is greater than =30&"Days Remaining" turn green & When Cell Value is less than =30&"Days Remaining" turn red.
    But when the cell is showing 1 - 9 days remaining it turns to green rather than red. How do I fix this?

  7. Hi anyone please help me how calculate expiry date.

    For Ex :- Training start date 11-Jan-17 and training end Date 15-Jan-17.

    What will be training expiry Date after 3 years in formula.

  8. My spreadsheet has a last revision date column with a date and a "Date of next review" column next to it with the formula of =S114+365. I would like to have the "Date of next..." to be highlighted if it is within 30-60 days yellow and less than 30 days in the future as red

    formula =AND($A2-TODAY()>=30, $A2-TODAY()=1, $A2-TODAY()<30)

    isn't cooperating, any help is much appreciated

  9. Hello & thanks in advance for the assist!
    I'm using conditional formatting for color coding cells with dates (formatted 01-JAN-17). In column A, I've called out/highlighted in red dates older than 1-JAN-17. In column B, I've called out/highlighted in green dates older than 1-JAN-16.

    Now, I would now like to call out/highlight in yellow also in column B, a combination of column A & B to call out dates in column A newer than 01-JAN-17 and in column B where dates are older than 01-JAN-16.
    Thanks!

  10. I have a lot bills to pay on a monthly basis. I want to create an excel spreadsheet that reminds me when to submit my payments. For example, my electric bill is due January 24, 2018. I want to make a column with green fill color stating that I am at least 10 days from the due date. When it is 5 days from the due date, I want the fill color to turn yellow.
    Can you please help?
    Thanks.

    Rino

  11. Status Budget Current Phase Target prod
    12/12/2017 100% 11/10/2017 12/25/2017
    12/10/2017 125% 10/09/2017 12/30/2017
    10/10/2017 50% 08/01/2017 08/09/2017

    Hi,
    Above data is my report example, i need to identify the over budget, one month old status, Passed current phase, Upcoming current phase, passed Target prod and Upcoming Target prod all together in one cell as a result.

    Please help me to code in this, i have tried in the below format but the last code i'm getting volatile as a error. I dono how to fix this.

    =
    IF($C$2>=100%,"Budget Overage.","",
    IF($B$2-TODAY()>30,"Status Report More Than 30 Days.","",
    IF($D$2=TODAY(),"Upcoming Target Prod Rel Date."
    IF($E$2TODAY(),"Passed Target Prod Rel Date.",))))

    1. Hello,
      For me to understand the problem better, please send me a small sample workbook with your source data and the result you expect to get to support@ablebits.com.
      Please also don't forget to include the link to this comment into your email.
      I'll look into your task and try to help.

  12. I'm trying to compare the difference in scheduled and actual times. So a person is scheduled to report to work at 9:00a but the clock in at 9:05. I need a column to show Late and On time when those two times are compared.

    1. Hello,

      You can use a formula like this:

      =IF(A1>TIME(9,0,0),"Late","On time")

      where cell A1 is “9:05”

      Hope it will help you.

  13. Hi

    I have a number of dates in a spreadsheet of when licenses for forklifts were issued in my company. We refresh the guys every 3 years.

    How would i go about making these cells turn red when the 3 years is up from the original issue date?

    Each cell contains the date when they completed the test

    1. Hello, Gerard,
      For me to understand the problem better, please send me a small sample workbook with your source data and the result you expect to get to support@ablebits.com. Please don't worry if you have confidential information there, we never disclose the data we get from our customers and delete it as soon as the problem is resolved.
      Please also don't forget to include the link to this comment into your email.
      I'll look into your task and try to help.

  14. Hi,

    Similar to the query above, I have a spreadsheet with Names in the rows, organized based on the day they were added to the spreadsheet and dates in the columns. I want the Day 1 column to be automatically highlighted on the day the name is added, and then automatically have the highlighted cells shift left as it becomes Day 2, 4, 7, etc. after that name has been added to the spreadsheet. I then want to create conditional formatting so that once an X has been placed in a cell (marking that that name has been called on that day), the highlight disappears as that task has been completed. Does that make sense?

  15. Hi :)
    I have a spread sheet showing columns with start dates, end dates, then data (i.e. deposits required, pre delivery payments required and final invoices required) all running off the start and end dates.
    Im trying to high light the cell for deposits required once the start date is a certain number of dates away. Can i achieve this ? i don't want the date cell to be highlighted i want the deposit required cell to be high lighted (or if both can be high lighted that would be even better)

    looking forward to your response IL get some serious brownie points if we can do this :)

  16. Hi, I have dates in column C and in column D is the date 29 days from the dates in column C. I want the cells in column D to change color when it is 25 days from the day in column C. Thanks for any help.

  17. Hello,
    This is my situation. I've made an employee schedule with conditional formating so that certain things are specific colors. The dates are across the top row. The employee names in the first column on the left. One of the items I formatted is that when I cancel an employee's shift I have formatted the cells to highlight red when I type a "C" in them. I also want the date of the cancel or "C" that was entered into the schedule to automatically appear in the column on the far right. And since an employee could potentially be cancelled more than one time per month I need only the most recent date to appear in the column on the right. I also want the information from the column on the right to carry over to the next month which is the next sheet in the same workbook. I have not been able to figure out how to write a formula to solve this issue. Any guidance would be greatly appreciated.
    Sincerely,
    Samantha

  18. If the date in H7 is before the date in G7, I want the font color to be green. If the date in H7 is after the date in G7, I want the font color to be red. How do I do that?

    1. Hello, Nicholas,

      you need to use the most basic formulas that will compare dates in conditional formatting, like the one below:
      =H7this article to learn more about conditional formatting.

  19. Hello,

    I wanted to automatically have the date and time in column B generate whenever an entry was made in the corresponding row of column A. I was able to accomplish that, but now the tricky part is getting cells A through D for that row to change yellow if the date/time generated in B is between the the current date at 6am and 630pm, and then change blue if the date in B is between the current business date and 5:59am on the next day. I was able to get the blue shade condition to work, but not the yellow for the morning entries. Would you be able to assist with a formula?

  20. Hi is there a way I can highlight dates in a column that cannot exceed another date in another column? For example, I have a spreadsheet where one column consists of dates where patients received their services and another column expressing their discharge date. I want to look for any discrepancies where the service dates exceed the discharge date.

    Thank you.

    1. Hi, Kelly,

      you need to create a simple conditionally formatted rule where one date (let's say, in A1) is bigger than the other (for example, A1>A2).
      Please take a look at this point of the article to learn the principle. You can adjust the formula, simply change "TODAY()" to the cell that contains other date for comparison.

      Hope this helps!

  21. Hi, I have created a spreadsheet that contains a column with a list of review dates for patients. Can you help me find the best formula to use so that the dates that are overdue will show in red, the dates that are due within two weeks will show in yellow and the dates that are more than 2 weeks away will show as green. There is another column next to this one that shows wether a patient has an appointment booked (it has the appointment date in it), is there a formula I could use to ensure that the dates in this column are ahead of the actual review date?
    Thanks very much

    1. Hi, Leigh,

      it's very difficult to come up with any particular formula since we don't know how your data is stored.

      Please take a closer look at the "Example 3. Highlight upcoming dates and delays" part of the article above and you'll see the formulas that may be of great help.
      Otherwise please send us a small workbook with your sample data to support@ablebits.com. I kindly ask you to shorten the table to 10-20 rows.
      Our technical specialist will take a look at your task and try to help.

  22. I have a list of 20 names (A2 thru A21) who are participating in a 6 week program. Column C is adm/week 1. Column D is week 2(7days from date in Column C). Column E is week 3 (7days from date in Column D), and so on. The date of each of the 6 weeks is populated in subsequent columns/rows using the formula =DATE(YEAR(C3), MONTH(C3), DAY(C3)+7). I am trying to figure out how use a formula so all participants in week 1 will have a yellow cell(column C), week 2 a light red cell(column D), week 3 a light green cell, week 4 a light purple cell, week 5 a light blue cell, and week 6 a light tan cell. Can you help me?

  23. Hello,

    Can you please help me to get appropriate excel formula for the following case?
    I have the work sheet that contain different information and I wanted to get the warning when specfic name is incerted & the dead line is passed.
    eg. Column A= the cell where the date is recorded
    Column B= The list of names
    Column C= Dead line dates
    So, I need to get the alarm (red color) when the two conditions are fulffliled. i.e The name is inserted among the list of d/t names and the deadline is passed.

    Thank you in advance.

  24. kindly advise to get the formula for expiration after 30 days and after 5 days using conditional formatting.

    Ex.

    Date created: Sept 1 then it will expire after 30days or it will expire within 5 days.

  25. how can I formulate this one: example

    Column 1 = August 01, 2017 10:08 and
    column 2 = August 01, 2017 16:00

    Time should not be exceeded to 4 hours, if its exceeded comment should be delayed, if not exceeded its not delayed

    Thank you

  26. In your first example of using the built-in date conditional formatting I had already done this, but I would like to have it format the entire row instead of just the cell. I have three conditions set up.
    1. Is anything "This month"
    2. Is anything "Next month:
    3. Is anything before today.
    1 overrides 3. My formatting works well, but I wish this set up would highlight the entire row based on these conditions as opposed to just the cell. Anything further than the next month will not need to be highlighted, but this will be an ongoing spreadsheet with changing dates as information is updated.

    1. Hello, Adam,

      to format the entire row you need to open Conditional Formatting Rule Manager (Home tab > Conditional Formatting > Manage Rules), select the rule and enter the whole row to the Apply to field (e.g. B:B, or A1:C1 supposing you have 3 columns).

      If you don't want the other rules to be applied when the first condition is met, make sure to select the Stop If True check box next to those rules in the same Conditional Formatting Rule Manager.

      Hope this helps.

      1. This works for columns, but not rows. If I go to manage rules and select a bunch of rows (say 2-11) it still only highlights the cell within that date range, not the entire row. I have columns A-M and the only column where the date range matters to me is column I. My conditional formatting works to highlight dates in a range in that column, but I would like it to do something like highlight all of row 3 if the date in column I falls in my range, instead of just cell I3.

        Thanks for your help.

  27. If at all possible I would love to send in a snapshot of my spreadsheet so that you may easily identify my issue and help to resolve in a timely manner. Could you please provide me with a forwarding email address.

    Thanks In advance,

    Lemar Harper
    (915)929-4934

  28. I am attempting to format blank cells so that when a date is entered into column D, column E will populate with the expiry date. I'm confident that my formula is correct but once it is applied those cells with no date in column D are being populated with a date in column E. See below for clarification

    Formula in active cell E4: =DATE(YEAR(D4)+1,MONTH(D4),DAY(D4))

    Rank Trained Expires
    8/15/2016 8/15/2017
    9/30/2016 9/30/2017
    9/10/2016 9/10/2017
    11/14/2016 11/14/2017
    11/16/2016 11/16/2017
    8/31/2016 8/31/2017
    8/31/2016 8/31/2017
    8/2/2016 8/2/2017
    9/2/2016 9/2/2017
    8/29/2017 8/29/2018
    12/31/1900
    12/31/1900
    12/31/1900
    12/31/1900
    12/31/1900

  29. Hi
    I have a list of various deadline dates. I would like to add a column for "activity start date" which would be fixed at 2 weeks prior to the deadline date - so the formula would be the same but the actual dates will all be different

    Is there such a formula as "activity start date" = "deadline date" - 2 weeks

    deadline start
    31.6.2017 needs formula to calculate and input "17.6.2017"

    Thanks
    Paul

  30. I have a spreadsheet where I have a sent date and to be completed date. If the Sent date is between 7-13 days before the to be completed date it needs to be yellow and no color if it's 1-6 days before the to be completed date. If the Sent date is more than 14 days after the date to be completed date it should turn red. Now if the project was completed in the time frame and there is a Y in the completed column the cell needs to go back to join color. Someone please help me!!!

    1. Hello, Heather,

      since you have 4 conditions, you will need to create 4 rules for conditional formatting using AND function. Also you need to know how to subtract dates in Excel.

      So, if your Sent date is in A2 and To be completed date is in B2, your first rule will be like this:
      =AND((B2-A2)>=7,(B2-A2)<=13)
      Choose the filling, make sure to apply it to =$A:$B, and check the Stop if true box.

      Please use this example and the links above to learn more about all this functions and create the rest of the rules.
      Hope this helps!

  31. Hi,

    Id like to know what formula to use to between two different columns using dates where column A would have 16/06/2017 and column B would have 17/06/2017 so I can tell if the date in column b is greater and have it highlit red in formatting please which i can do using =$A$1<$B$1 and formatting it red, what i am struggling with is applying it across the entire two columns for all dates as it wants to keep using cell A1 only

    1. Hi, Jake,

      if I understand your task correctly, the rule you're using - =$A$1<$B$1 - is correct, but you need to make sure that it applies to =$A:$B. Then both of you columns will be filled with red if the date in column B is greater than the date in column A.

  32. Dear Svetlana, thank you for your help on creating a calendar, highlighting wekends and holidays....
    I have a big table with a row for each of 2000 employes, and a calendar from 2013. till today in the same table. In another table I have for that period seek days for all employes. Each employee has a unique code. And in the second table one employee has multiple rows with 2 dates.
    I need to highlight for each employee the days when he was not working in the first table with the calendar based on the date ranges in the second table.
    I have tried conditional formating, but without any success :(
    Thank you for your help.

  33. I want to be able to set up multiple cells across 5 columns to show up different colours. 1 after the date is 7 days old, 1 after the date is 14 days old and one after the date is 21 days old.

  34. Hi Svetlana Cheusheva,

    How to highlight a cell by entering different dates.

    For Example: i want to highlight dates from 1 to 5 GREEN, from 6 to 10 BLUE and from 11 to 15 RED.

    Thanks.

    1. Hi Mudassir,

      I assume you want to highlight dates depending on the day of the month. If so, set up 3 different rules for your range of dates with the following formulas, and choose a different color for each rule:

      1 to 5 GREEN: =AND(DAY(A1)>0,DAY(A1)<=5)

      6 to 10 BLUE: =AND(DAY(A1)>5,DAY(A1)<=10)

      11 to 15 RED: =AND(DAY(A1)>10,DAY(A1)<=15)

  35. I am trying to get a cell to highlight "good" in green if a date is met and "rescrub" in red if the date goes beyond the required date. For instance, reports are due by the 20th of each month. How can I insert the above parameters if the date is met or not met?

    1. I also would like to know..

  36. I have a question about my spreadsheet that contains orders. I have a column for order dates, one for wedding dates and then one for estimated shipping dates. How do i get excel to automatically flag an order if the wedding date is after the shipping date?

    any help to create the condition would be greatly appreciated!

    cat

  37. Hi,

    I was wondering if you could point me in the right direction, please?

    I have a spreadsheet and I'm trying to set up conditional formatting rules, 1 that will highlight any orders with an order date older than 1 week (Column E) where there is no Estimated Delivery Date (Column L) and another to highlight any order older than 2 weeks (Column E) where there is no Promised Delivery Date (Column N).

    Any help would be greatly appreciated!

    Thanks
    Parry

  38. Hi !

    It would be really great if anyone can help me figure out
    how to color a cell if (For example)

    Color cell A1 if any of cell in B1, C1, D1 contains the date after 5/20/2017. If there is no date, leave it blank.

    Thank you so much !

  39. I have dates in Column A (15 FEb 2017) and Column B (31 Jan 2017). I need to color code column B when the date in Column B has gone 5, 10, 15days pass the date in column A and when the date in Column B is 5, 10,15 days within the date in Column A.

    Thanks in advance.

  40. Start Date Due Date
    4/24/2017 5/24/2017
    4/24/2017 5/24/2017
    4/17/2017 5/17/2017
    4/10/2017 5/10/2017
    1/20/2018 2/20/2018

    I want to highlight the dates in Due Date column, 7 days prior to current date and then change the highlighting from 1st day of next month. How can I do this?

  41. Hi friends,

    If am using the some tracker in excel for one year in that i need to differentiate the weeks in the month. for example - jan month 1st week yellow color, 2nd week green color, 3rd week pink color,etc the same will be followed for subsequent months by using conditional formatting option.

    Kindly help on this.

    Thanks in advance!

  42. hello,

    i want to know that if i want to highlight due dates in the column such that the due dates are remain highlighted even after the next month.

  43. Hello. I would like to ask some assistance regarding this matter. I have two columns - the first column contains the date until the certificate is valid & the second column named as STATUS. I would like to turn the "STATUS" column to have values such as "UP-TO-DATE" or "EXPIRED" this is in reference to the date(s) of the first column against the present date.

    Example

    VALIDITY OF CERTIFICATE STATUS
    January 01, 2015

    let's say the date today is April 25, 2017. Looking at this, the certificate is already expired. How am I going to format it so that the STATUS column shows UP-TO-DATE / EXPIRED?

    Thank you for your assistance.

  44. I have a spreadsheet of clients who we ring every 3 months. I have a column with the date of the last call - I'm attempting to format cells where the date is over 3 months ago so we know who needs a call. I'm using the formula - =$C2-TODAY()>90 but the results I'm getting are not what I'd expect e.g. today's date is 14/4/17 but it's highlighted a cell 23/3/2017. Some of the cells don't have dates in them but text such as not active - is this causing my troubles or have I made a mess of the formula

  45. Hi

    I have a date received column (Column A) and column titled notice of complaint issued (Column B). I want the notice of complaint issued cell to highlight red if the date entered is more than than 28 working days after the date received.

    Struggling to get anywhere near working that one out, so any assistance hugely appreciated.

    Thanks
    Rob

    1. Hi, Robert,
      first of all, you need a formula which will count the number of working days between your dates – that would be Excel NETWORKDAYS function (you can read more about it here). The next step is to use this function when creating a formatting rule for your cells:
      =NETWORKDAYS($A2, $B2)>28

      Follow the steps from the article to create a formatting rule using the formula above. Hope it helps!

  46. Hello,
    I have not really found an answer to my problem and I hope you can help me.
    I am comparing 2 days and 14 days difference
    Column B (arrival date): 30/08/2017
    Column A( expected delivery date): 15/08/2017

    If Column A has less than 14 days after the arrival date (Column B) to be highlighted in red, also if the date is even before the arrival Date (Column B) also to be highlighted in red.

    Many thanks in advance

    1. Hello, Dilyana,
      for your first condition, you need to create a formatting rule with a following formula:
      =($B1-$A1)<14
      As for the 2nd one, please, explain in more details the condition you wish the dates to meet.

  47. Hi,
    In my spread sheet I want to highlight an entire row based on the year, i.e. rows with 2016 to be blue, 2017 to be green. The cell will contain a full date - 2016-11-30 - but I don't care about the month or day. The only information I have found seems to be on months and days. Can you help me?

    1. Hi, Elizabeth,
      there are other ways you can play with.

      One of them, is to create a new formatting rule, where you choose Format only cells that containspecific text - containing – end enter 2016. And make these cells to be filled with blue. Same goes for 2017 – a new rule with a corresponding text value and colour in the rule.

      Another way is to use YEAR function. Let's say you enter dates into A column, and there's 2016-11-30 in A1. You create a new formatting rule with a next function:
      =(YEAR($A1))=2016
      But the same should be done for dates that contain 2017.

      Hope it'll help!

  48. Hi,
    I have a question - i have a sheet with multiple columns, now for example if i put a date in column R then i would like the entire row to be orange, later once i decide to put a date in column S then the same row should turn Green. How do i do this.

    1. Hi, Bosco,
      are you going to put only dates in these columns? If so, you can create two formatting rules that will check if those are blank or not. The formulas for the rules are:
      =$S1<>"" and =$R1<>""
      If your data begins from the second or the third row (and so on), change the number in the formula accordingly.

  49. Hi...
    Lets suppose we have set particular values corresponding to date of the month
    How can i apply a formula i which the value of current date reflect in separate cell

  50. I am trying to format one cell to highlight when the year isn't current. The names listed must complete a task at any date during the current year. After December 31st of each year, the task is overdue. The cell currently has only the year, but it would be nice to have the actually date they completed the task and still have December 31st of the current year as the condition. Thanks for your assistance.

    1. Hello, Sherry,

      if the cell to format is A1 and it contains a full date, use the next formula in conditional formatting:
      =YEAR($A1)<YEAR(TODAY())

      If there's only a year entered into the cell, the formula will be:
      =$A1<YEAR(TODAY())

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 :)