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 14. Total comments: 1245

  1. 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.

  2. 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.

  3. 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!

  4. 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.

  5. 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?

  6. 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.

  7. 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.

  8. 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

  9. 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?

  10. =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

  11. 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().

  12. 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.

  13. 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.

  14. 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

  15. 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.

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

  17. 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

  18. 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

  19. 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.

  20. 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.

  21. 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?

  22. 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

  23. 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! =)

  24. 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.

  25. 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.

  26. 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!

  27. 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

  28. 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!

  29. 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

  30. 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.

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

  32. pls tell me which formula use to before one day cell automatically color for delivery status

  33. Can someone please help me. I am trying to create a formula that will highlight the call yell onw 1 year from the date in the call.

    I.e. if one of the dates in cell N is 5-Jan-2020
    Then on 5-Jan-2019 the cell will turn yellow

  34. Update - I have used the COUNTA function, but that counts all cells with text and I want to specify Holiday & Half, but COUNTIFS doesn't work?

  35. Hi,

    I have a spreadsheet that covers the whole year for holidays and deducts them from the persons allowance. What I would like to know is, if at the end of January I want a column that calculates how many days have been taken since 1st January (E6), how do I create a formula in column AA6 that counts full days and half days holiday (i have formulas set up to record these)? Any help would be really appreciated.
    Thank you.

  36. hi
    i need to highlight one row when the first three columns of dates are came to be similar

  37. I have range of dates with time updated in a cell having 500 records. I want only the only the dates to be highlighted for the time between 6pm-8am. my first record will be highlighted because time falls between 6pm-8am and second record is starts with 4pm so it is not highlighted. Please anybody get me the solution using conditional formating or filtering or any other method, but don't split the date and time. if you giving in vba also great or in excel. Awaiting for your result solved as early as possible will be very much grateful to you.

    Example

    12/13/2018 21:28
    12/13/2018 16:02

    Thanks and regards
    J. Prasad.

  38. I want to format my spreadsheet so that any date more than 365 days old from todays date turns Red, while all other current dates turn Green when entered into any cell.

  39. Thank you!

  40. Hello,

    How do I change the color of a field when it's date is "overdue" based on the date in another cell. Let's say the date in B2 is 12/3/18 and a field is automatically populated to show a due date 7 days away in B3 is 12/10/18. How do I get that cell (B3) to turn red if the current date is equal to or pass that date (showing that it is now late). The date in B2 will never be the same.

    I hope that makes sense.

    Thank you

    1. Hello, Del.

      If you need to set a conditional formatting rule to change the cells' color based on another cell value, you may find this article helpful.

  41. I have a work/task tracker to use at my team meetings and I would like a 'bookmark' type identifier to show where this week is.

    The sheet has week ending dates (23/11/18, 30/11/18, 7/12/18 etc)across columns H:BP at row 4.

    To draw attention to the current week (so staff can easily see where to update the work progress) I have added conditional formatting 'Highlight cell rules' - 'A date occuring' - 'This week' to H4:BP4 to fill the cell matching a date occurring this week a particular colour.

    I want the corresponding column cells (H:BP)at row 1 to reflect the same font/fill colour (to make it easier to find)to change when the row 4 cell is highlighted. (This doesn't have to apply to the whole column - but would be handy to have as as option).

    I have previously done this (the cheeky way) with individual dates in the columns then adding 'TODAY' text in white font in all the cells in row 1 then applying the conditional formatting for row 1 cells to apply dark fill - hence revealing the 'hidden' white font in row 1. However I can't for the life of me work out how to apply this when using dates that are a week apart ('this week') and not 'Today'.

  42. Trying to make a conditional format based on a cells value of the date that has been inputted into that cell and have program shade yellow for +5 years beyond that date and then red for +ten years beyond that date. Example would be if I input 10/12/2015 in E4 I would like it to shade yellow at +5 yearson 10/12/2020 and then red +10 years at 10/12/2025.
    I would like to ba able to do this for any date that I input since I will be inputting various dates into my cell in column E.

    1. Hello,
      It looks like the following steps will do the trick for you:
      - Select the necessary range and go Conditional Formatting -> Manage Rules -> Add new.
      - Choose the "Use a formula to determine which cells to format" option.
      - Apply the formula like the one below:
      =YEARFRAC(F2, $E$4) >= 10 and =YEARFRAC(F2, $E$4) >= 5

      - Set the necessary color and hit OK.

      Hope this is exactly what you need.

    2. Hi Did you manage to find a solution for this? I have a similar problem trying to identify employees 5 years in the business 10 years in the business etc etc

    3. I need to do exactly this - were you able to find a solution?

  43. Help!!!!

    I’ve created a timeline in excel and want to have the conditional format fill in the color based on the start and end date. The headers I have are for the start of the week. Example the top header would show 10/22/18, 10/29/18, 11/5/18.

    And my Start date for a task would be 10/22/18 and end date of 10/31/18. So I need the cells under 10/22/18 and 10/29/18 to be highlighted. How can I do this?

    1. Hey Rosii,
      Did you get figure this out? I need to do a similar function and I am struggling.
      I basically have three columns: Allocation, Start and End Dates. So, If I choose a start date as 01/01 and End date as 06/01 at an allocation of 100% , then I need a function that will allocate 160 hours in six columns from Jan to Jun.

      Please help!!

  44. HOW CAN ENTER FIXED TIME FOR INVOICE DETECT THE DAY I AM USING AND NEXT
    NOT TO CHANGE WHEN OPEN DIFFERENT DATE NOT CHANGE

  45. Hi,
    i reviewed your all formula but not found any of them as i was looking for.
    can you let me know what is the formula i can use for getting 3 color in one cell. like below.

    yellow color - 10 days early of due date.
    Red color - if the due date has passed.
    Green color - If can meet the due date.

    Thanks /Zaman.

    1. You can use Home>>Conditional formatting >> Manage Rules >> New Rules >> and choose "Format only cells that contain" and choose Cell Value for less than 10 days , equal to 10 days , less than 10 days
      Hope this help to you

    2. You would use the formulas to highlight future dates, but apply 3 different rules to your columns.
      Red would be =$K3=1, $K3-TODAY()<15)

    3. Hi Zaman, im just wondering if you had any luck working this formula out? I am also needing a formula to highlight cells early of due date

  46. ALREADY EXISTING FORMAT - 13-Aug-18
    REQUIRED NEW FORMAT - 13-08-2018
    PLEASE GUIDE US HOW TO CHANGE THIS FORMULA

    1. If this is already formatted as a date, select the cells or column that you want to format, select "Format > Format Cells", select the "Custom" option, and enter the format "dd-mm-yyyy"

  47. I have a spreadsheet where I need to format an expiry dates in a column, based on 3 different dates (which can change)each date range will be shaded a diffener colour.
    i.e. red for dates pre and including 15sep18
    yellow for dates between red and green dates
    green for dates after and including 14Apr19
    Can you please help?

  48. need to apply conditional formatting with time.thanks

  49. i want to know as below :

    i have marked a conditional formatting on a particular cell , if the value in the cell exceeds a particular amount then it turns red , i want to know the date when the cell is showing red , so that it becomes an alertness

  50. good day

    Could you please assist me I have a spreadsheet with one culm for date and I want each cell to be automatic highlighted with red when it is 3 month old from the current date, yellow when it is 2 month old than current date and green when it is 1 month old from the current date
    Thanks in advance for your assist

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