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 13. Total comments: 1243

  1. Please help! I have a sheet where a particular item expires every 2 year. What I'm trying to do is have the conditional formatting come into effect when the 23 month marks hits; and I have no idea if this is even possible. The original date is in the format dd-mmm-yy and is starts in the F4 spot. Any help would be much appreciated. Thanks!

    1. Hello Jeff!
      Please go to Conditional Formatting- > New Rule -> Use a formula to determine which cells to format and set the following formula for column A:

      =EOMONTH($A1,23) > TODAY()

      Hope this is what you need.

  2. Thank you, I was able to combine and redefine your formulas! You made my life much easier.

  3. I would appreciate it if someone can assist me with a date formula :
    I have 2 cells A1 and A5
    In cell A1 is todays date then Cell A5 should shows current month and Year if todays date is between the 1st and the 15 of current month but if todays date is between the 16 and end of month Cell A5 should change to next month and related year.
    For instance
    A1 20/04/2020 then A5 should be
    May20
    If A1 14/04/2020 then A5 should be Apr20
    Any help would be highly appreciated

    Leon

    1. Hello Leon!
      If I understand your task correctly, the following formula in cell A5 should work for you:
      =IF(DAY(A1)<=15,A1,DATE(YEAR(A1),MONTH(A1)+1,DAY(A1)))
      If it is necessary to change the date format without changing the date itself, Custom Format in A5 should be used. Please go to Format Cells, choose Number -> Custom Format and set "mmmyy"
      I hope this will help, otherwise please do not hesitate to contact me anytime.

  4. i have a table for security report with date 1 as starting date and the whole month is triggered by change of month. i used date value and EOMONTH FORMULAS TO ESTABLISH THE CALENDAR. So each date relies on previous date because there is a formula. above the cells is names of days from Monday to Sunday which changes when i change the month because the boxes have formulas too but i format them to "ddd" only to show day name. for this am unable to highlight weekends with conditional formatting for "sun" & "sat". how can i make it.

  5. I need help. I have a start date in column B and end date in column C. Column E to P are the months of the year. I want column E to P to reflect the start and end date with colour blue, for eg if i hv January in column B, and June in column C, then only columns E to J turn blue. How should I do it? Am totally new with Excel!

    1. Hello Flora!
      You may use Conditional Formatting- > New Rule -> Use a formula to determine which cells to format and set the following formulas:
      For column E:
      =$C1 > DATE(2020,1,1)
      For column F:
      =$C1 > DATE(2020,2,1)
      For column G
      =$C1 > DATE(2020,3,1)
      etc.

  6. I have a spreadsheet with a column that is a date format. I am needing a way to set a conditional rule for invalid dates ie 09/31/2020 to highlight the cell red.
    With this I need it to trigger if the data is copied and pasted from one sheet to another or a way once I have all the data in the new sheet that I can run a macro to trigger all the rules on all the cells.

  7. I have an annual training spread sheet and want the cells to change colour 30 days before its due to expire. If there are 100 staff all with different dates they undertook their draining, do I have to apply the formular separately for each one?? I am struggling with the correct formula for one years time.

  8. Hi everyone, I have an item with list of different expiration dates and need my spreadsheet to highlight which ones to choose next based on which one will expire will expire first. Any ideas?

  9. I'm looking to format page 1 of a 2 page spreadsheet. On page 2 is a range of shift times, but I need page 1 to show, via color code of the shifts on a particular day. So should the spreadsheet be open on May 19th then data shown on page 1 as to what shift (via the color code) everyone is working on that date. I hope someone can help

  10. Hi,
    I have a workbook with list of supplies of items with different future expiration dates.
    I want to put a condition on the Exp.date cell, to alert me with a different color at 30 days from expiration and then again with a different color with just 7 days of expiration. (Goal to remove/then re-order expired supplies)
    I need help with the formulas. (I'm able to do it from "today" date but not from future date, for example, if item expire 3 days from today, then the today formula does not work)I will appreciate any help.

  11. Hello everyone, i need a help here. Need a formula that will turn cell red based on TODAY and other date cell, for example B2=RED if TODAY=>E2+4. And to ignore this formula if cell K2 has any value or text or anything...

    Thanks

  12. I am trying to format a cell to where it will turn yellow when it reaches a certain month. the situation is where when someone's birth month is within 3 months of the current month, the cell will turn yellow.

  13. Hi

    I would like to know the formula for highlighting all times (Say in column A) that are later that the time in Cell B2. Is there a formula for this, as conditional formatting greater than does not seem to work.

    IE:Time in Column A1 6:30AM, A2 6:45AM, A3 7:15AM, B1: 6:35AM. Now highlight A2 & A3 Only

  14. Hi,
    please help me. I have a excel wherenin i want that data in column 1 in sheet one gets copied to coulmn 1 of sheet 2, once date changes, and data in column 1 should be deleted automatically in column 1 of sheet 1. This should happen after every date change

  15. Hello! I have a spreadsheet that lists upcoming dates for months in advance. There is a conditional format that highlights the weeks in different colors and it works perfectly. However with the new year approaching, the weeks after December 30th are not highlighting. Is there a new formula to correct this?

    My current formula is: =WEEKNUM($C3,1)=(WEEKNUM(TODAY(),1)+1)
    =WEEKNUM($C3,1)=(WEEKNUM(TODAY(),1)+2)
    =WEEKNUM($C3,1)=(WEEKNUM(TODAY(),1)+3)
    Etc.

    Thank you!

  16. I am using Workday formula whenever I put date in say A1 cell and it will be getting Calculated with workday formula in say B1 formula. At the same time when I set formula for entire B column date will automatically get calculated after putting in respective A column. But when A column is blank say A2 is blank at that time B2 should also show blank; instated B2 is showing me value (i.e 6-Jan-00). Please guide on this.

    Thanks,
    Deepali

  17. The title of this article is: "How to conditionally format dates and time in Excel" yet there is no information about formatting time, only dates.
    I want to format cells which contain a time (eg - 00:05:22). Is this possible?
    Thanks

  18. how can i create sheets highlighting red color in dun amount
    Please help me how to create when due amount received cell color change

  19. Please help (what am I missing)?
    I have a spreadsheet to track my time. I am trying to highlight a column based upon the current day.
    My dates cover 2 weeks and go across with the hours worked listed in cells below. My dates are formatted "dd" (i.e. for 11/5/2019 is shows 05). The dates are in row 2.
    I used conditional formatting ("use a formula to determine..." ) with the following formula: (I have selected E2:R33 area) E$2=today() and then I have selected the format of a yellow fill color.
    It is not working and I cannot figure out why? What am I missing or doing incorrectly? (NOTE: I have tried reformatting the date and even entering in today's date and still does not seem to work.)T.I.A.

    1. Try $E2-Today()=0

  20. I am having an issue that I cannot find the answer for:

    I am formatting my cells to display color simply by TODAY() date (Red for ).
    The problem is, it isnt changing colors with the date. IF it does change color, the date is wrong (itll highlight RED when the date is clearly several months in the future or vise versa).
    Date Calculation is set to Automatic, Number drop down is on GENERAL. It just wont do anything at all. Current format is mm/dd/yyyy.

    Can somebody ANYBODY, tell me what I am doing wrong?!

    1. Hi jon, did you receive a response or discover a solution to your problem? I am also having the same issues.

  21. Fill cell C with color if the date is 30 days later than cell A:
    Cell A = 03/01/16
    Cell C = 05/02/16
    The conditional formatting would make Cell C fill with orange.
    Everything I find is based on today's date and not two dates that can be at any time. It would be great if I can also fill the cell with a different color if within 30 days.

  22. Hello,

    I am struggling to set up conditional formatting for a specific time frame
    for example Green if between the times 8:00:00 AM and 8:00:00 PM. I have tried many things but cant seem to get it to work. Any thoughts?? I am having to use Google sheets at work so usually we can't do as much as you can with Excel, but hoping someone knows how. Thank you!

  23. I have a spreadsheet with a Expired due dates in one column . I'm trying to get the cells to turn yellow when its 60 days before the due date , and turn red when its expired .
    My expired due dates are in column G .
    Name Course Expired /Due date
    Jane Doe Annual Training 26/09/2019
    John Doe Orientation 01/02/2020

    Hoping you can help me. Thanks in advance .

    1. Dear all,
      Hope my all friend everything, but i am not ok, we are facing in problem in excel file format issue, please help me about this, Problem: one cell have amount date wise color change issue, how can it's possible, plz help me friend,,,

      Kamal
      From Bangladesh.

  24. Hi, am have created a drop down list in D to prioritise tasks from 1-4. I would like column E to auto update the due/target date for each line task based on a 30, 60, 120 and 240 day due date form date created.
    Is this possible?

  25. Is there a way to copy conditional format to each row.
    I have a spreadsheet which shows date someone last attended I wanted it to go one colour if the date is between 180-269 days, highlight a different colour if date is 270-364 and a different colour if more than 365

    I managed to do it on one line but when I tried copying it it used the data from first line

    1. Copy the cell with the conditional formatting you want and use the Format Painter to paste the format to the cells where you need the conditional formatting.
      If it's a lot of cells, select the block of cells and then click manage rules in the conditional formatting tab.
      Make sure it's set at "for this worksheet" and not "current selection".
      Click the up arrow next to the conditional formatting you want to apply and select the cells in the worksheet in which you want the conditional formatting to appear. Click apply and ok.

  26. Help on formulas to highlight future dates in calendar.
    Have a 12 month booking calendar Coloums ( A:AG) with separate Arrival And Departure date input cells, say coloum ( AJ : AK ) what i would like is, as i enter arrival and departure dates ,EG. enter (arrival date (7-03-2020) departure date (21-03-2020).) reverent cells between dates in calendar to change colour
    Thanks for looking.

  27. hi. i have to get a "Icon Set" for the below given information.
    there is 3 cells with date which is "PO Issued Date", "PO Delivery Date" & "Delivered Date".
    1. i need green color on "Delivered Date" if the Date is entered.
    2. i need yellow color if the date is not exceed on "PO Delivery Date"
    3. i need Red Color if the "Delivered date" is not filled when the date exceed the "PO Delivery Date".

    PO Issued Date PO Delivery Date Delivered Date
    7/20/2019 7/26/2019

  28. I cannot perfect R/A/G conditional formatting when using 2 dates. A deadline date and an actual date of completion.

    Green if date of completion is on or before deadline date
    Amber if date of completion is blank up until deadline date
    Red if deadline date passes or date of completion is after deadline date

    Any tips?

  29. =TIME(HOUR(M18),MINUTE(M18)+5,SECOND(0)) I am using this formula to show the incremental time of 5 minutes in each column(left to right)to have a color through conditional formatting...till the time slot given for 24 hours(split in five minutes each)its coming perfectly. however when the calculation go beyond 24 hours it is not functioning properly. hence pl advice how add days to this formula

  30. I have two columns. The first contains dates. The second contains $ value. I choose a cell in the worksheet and apply formulae. =if(first cell: last cell="today()",(first cell: last cell="$value). What I am seeking to do is apply the $ value that is opposite the date for today().

  31. Hey, I have a table with "employee name" column and "date of hiring" and I should aplly a conditional format for employees whose last name is "DEDU" and were hired this year.

  32. Hello,
    I have a column with "Due Dates" and another column with "Completed date". I want to color format the first column to turn green if the date in the "Completed date" column is equal or lower that the due date value. And to be orange if it is greater (which will mean that it was completed but past its due date).
    Also, I don't want any color if some cells in the column of "Completed date" are still blank.
    Thanks.

  33. Hello,

    I'm maintaining an attendance table in the following format.

    01 Wed IN 01 Wed OUT
    08:27 17:16
    08:36 14:31
    08:38 17:07
    08:32 17:05
    08:47 17:05
    08:31 17:04
    08:16 17:13
    08:31 17:13
    08:29 17:05
    08:40 17:06
    08:32 17:02
    08:52 17:05
    08:36 17:08
    08:30 18:37

    I want to apply conditional formatting for "IN" column and "OUT" column. If IN time > 8:45, the font in that cell should be RED. If OUT time < 17:00, the font in that cell should be RED.

    The data in IN and OUT columns is a result of LEFT(cell, 5) and RIGHT(cell,5) from another column that records every IN and OUT entry of the staff.

    I have tried conditional formatting options but I'm obviously doing something wrong. Tried formatting the cells as Time, Custom, etc.

    Appreciate your help.

    Thanks.
    Rupali

  34. Is there a formula that puts the current date only when THAT ROW is edited? I’m trying to create a running log for pipe load-outs and am trying to make it to where the date cell puts in the date that data was entered into that row only and will not change when I add to it on a later date.

  35. First of all I would like to thank you on your tutorials you are absolutely great..I have a question regarding conditional formating with dates,I work with a large number of package delivery and to track all of it I use this type of formula:
    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=1, TODAY()-$A2<15)
    just with less days,I was wondering could you use a WORKDAY function so that it counts in the formulas above just the working days not weekends as my schedules are regarding only working days.Would that work?Thank you and keep up the good work :)

  36. I need a formula A with the Dispatch date mentioned and B also date of Invoice Date if A column date is less than old 2 days then highlight both cells if B is mentioned date in cell then highlight should be disable.

    Sample
    Dispatch Date Invoice Date
    17-04-19 no Highlight
    13-04-19 15-04-19
    09-04-19 10-04-19
    15-04-19 Highlight
    no Highlight
    26-03-19 Highlight
    15-04-19 Highlight
    16-04-19 no Highlight
    14-04-19 Highlight

  37. hello
    I am trying to calculate for bigger spread sheet some bits
    basically in one cell (D2) i have "Office 365 Business Premium+Enterprise Mobility + Security E3" and in other column G2 i am trying to put "IF(ISNUMBER(SEARCH("Premium",D2)),1,0)", in next one-H2 "=IF(ISNUMBER(SEARCH("Mobility",D2)),1,0) etc and It is all coming up to "0" what is wrong
    can I have some advice please

  38. I am trying to built a database of clients which every 90 days I need to update their record and I am wanting the update column to color the cell a color when the date is 90 days from the last adjustment. For example a clients new records was built 02/01/2017, the record was last updated 02/28/2018 and now I am updating the record on 04/08/2019. The next time I would need to update the record is when my today() is July 8 or after 90 days and not before then. I just have one column that holds a date and and each time I update the record it will reset to conditional formatting.

  39. When you describe how to highlight dates within a date range, you posted:
    Less than 15 days ago: =AND(TODAY()-$A2>=1, TODAY()-$A2<15)
    However, I could not get that to work for me when I tried it for between 130 and 365. After some angst I used =IF instead of to =AND, and then it worked fine. I am curious to know why that is.

  40. I am trying to do the following:

    Header Row 12/1/2018 1/1/2019 2/1/2019
    Columns
    Start Finish
    12/1/2018 1/1/2019
    12/1/2018 1/1/2019

    I am trying to compare the dates in the Column "Start" and "Finish" to the header rows and conditionally format the color based on whether the date is within range or not.

    Is this possible with Excel?

  41. Hi there
    I need help with a future date formula. I need a policy to expire every 3 years (2019-2022), rather than annually. I need this to show as GREEN when in date, YELLOW a month before its due to expire, and RED once this has expired. Which formula do I use to cover these formatting? I've tried it the normal way but used previous dates (2015-2019) to get the desired results, but unsure how to get this to work for the desired current/future dates 2019-2022. Whenever I apply the same formula/formatting my policy which is in date, stays white.
    Any help would be greatly appreciated.
    Kind regards

  42. Hi,
    I have been trying to figure out the necessary formula for conditional formatting for the past few weeks and have been unable to locate it.
    I am working on fixing the conditional formatting for "Audit Due Date Tracking". In boxes C & D, there is a formula set up to show 2 weeks (14 days) from C="Sent" and D="Due(2 weeks)". What is needed is conditional formatting to display "PINK" in the applicable rows before the 2 weeks are up and is at 12 days to indicate that an email needs to be sent to the recipient. Next, conditional formatting for E="Received Date" needs to be set up so that "YELLOW" shades the rows that are past the 14 days; indicating that they are all past due.
    Any help someone can offer is greatly appreciated! Thank you in advance! =)

  43. Hello, I want to run a program in my excel file. Which contains three columns and 18000 rows. To, simplify my data i want to select the vales like 0,0.5,1,1.5 etc. and against these values i want to select the whole row. how can i do this by using one simple formula in EXCEL.

  44. I have created a spreadsheet tracking multiple tasks that are all carrying a date. Many of the cells dates a re defined formulas to define the next task day being x number days. Current conditional formatting is red for past todays date, green for within the next 2 weeks, and just plain for past the 2 weeks. How can I highlight and keep the past date in a cell of the completed task and still maintain the links driving the future dates. Essentially want to show the task cell in yellow as completed but keep the date intact. Today because it shows in the past it is red and would override the color if I just changed it to yellow. I can type in complete in the cell and change it, but hen the future days error out of course due to the existing formulas driving the future dates Thoughts?
    Thanks...assuming it makes sense.

  45. Hi -
    I am trying to format a cell that if the date in the cell is after todays date and after cell A17, it should highlight. Any ideas?
    Thanks in advance!

    1. were you able to figure this out? I am looking to do the same thing.

      Thank you!

  46. i want create Excell sheet For Apartment Rent Details
    Example: We Have 6 Apartment.each apartment Payment in 3cheques
    i want know apartent1,2,3... Payment details.next payment when will due

  47. Hi

    I'd like to know how to do the following:

    Have a table with the headings:
    Task name
    Start Date
    Duration
    End Date

    I want to be able to enter the start date and duration and it to automatically work out the end date. This is so that whenever I change the start date, it updates the end date based on how long it takes.
    In addition, is there a way to make it take into account weekend days? As in, if I input a duration as 10 days, I mean 10 working days (so two working weeks). If not, this isn't the end of the world; I'm just curious.

    Thanks in advance!

  48. I am looking for a formula that will allow me to conditionally format cell colour based on date. For example if our delivery date is today, I want to colour cells based on whether the delivery was on time (green), 1 day delay (yellow), 2 day delay (orange), 3+ day delay (red)
    ie:
    Data Period End Day 6 Delivery Date
    Jan 5/19 Jan 11/19

    so if Day 6 Delivery was done on Jan 13/19 instead of Jan 11/19 I want the cell with the Jan 13/19 date to be coloured orange

  49. Hello, Is it possible to apply a time format to a cell only under a specific condition? I would like for any result below a value of 1 to appear in a time format (hh:mm), like 3:30 or 1:00 instead of 0.1458 and 0.0417. I need the rest of the column to stay unchanged though. It contains text value like "2-day" and "6-day". How to create such a conditional formating? Thanks for your help.

  50. Thank you for your posts, they are incredibly helpful. I've been wanting to figure out how to do this for years.

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