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
by
Comments page 2. Total comments: 758
Hello, thanks for your work!
We have a problem with expiration dates, expiration dates after product openning. We ar using this formula to calculate expiration date after openning if product expires after 10 days: =IF(J3="";"";J3+10) J - openning day.
Ecample: Product X general expiration date is 2024-09-10, after openning, product expires after 10 days. We openned product on 2024-09-05, with formula we're using date we get is 2024-09-15, but, product expired on 2024-09-10.
Is there some formula that makes cell red, if expiration date after openning is greater than general expiration date?
Hello! The following tutorial should help: Excel conditional formatting formulas based on another cell.
For example, if the general expiration date is written in D3 and the formula to calculate expiration date is written in E3, the conditional formatting formula might look like this:
=E3 > D3
Or you can try this formula:
=(J3+10) > D3
Thank you for quick responce!
Can we apply formula for whole column? For example: H column - expiration date, J - openning day, L - expiration date after openning. But H2 may be different from H3 and so on. =E3 > D3 is valid for one cell. We need, if possible, formula for section $L$1:$L$400.
Hi! Select the range $L$1:$L$400. Then create a conditional formatting rule =E1>D1 for this range.
For more information, please visit: Excel Conditional Formatting tutorial with examples.
Great tips on formatting dates.
How do I format the cells based on dates comparing 1 column cell with another column cell for the whole column
i.e column B2 vs column C2 and the whole column if B2 is > C2
Hi! If you want to apply a conditional formatting rule to an entire column, select entire column and create a conditional formatting rule as follows
=B1 > C1
Read more: How to create a new conditional formatting rule.
Note that in large tables, formulas and conditional formatting for an entire column can slow down calculations.
Hi Alexander,
Thanks so much for taking the time to reply to comments and provide such a comprehensive article.
I am trying to use formulas to highlight past dates
More than 10 days ago: =TODAY()-$A2>10
From 4 to 9 days ago, inclusive: =AND(TODAY()-$A2>=4, TODAY()-$A2=0, TODAY()-$A2<3)
These are all just altered based on the examples in the article, however I need them to apply to all the cells in column J (excluding title column)
I have tried a few different things but none of them seem to work.
Can you please help me?
Sorry! Typo above ^^
This is what I meant to do:
red - More than 10 days ago: =TODAY()-$A2>10
yellow - From 4 to 9 days ago, inclusive: =AND(TODAY()-$A2>=4, TODAY()-$A2=0, TODAY()-$A2<3)
Need to apply these formulas to column J, any help greatly appreciated!
Hello Lauren!
Here is the article that may be helpful to you: Excel conditional formatting formulas based on another cell.
Select the range J2:J100 (cells for the conditional formatting) and apply your conditional formatting formula to this range.
Formula from 4 to 9 days ago - =AND(TODAY()-$A2>=4, TODAY()-$A2<=9)
From 4 to 9 days ago, inclusive: =AND(TODAY()-$A2>=4, TODAY()-$A2=1, TODAY()-$A2<3)
Sorry this keeps changing my comment.
Hi..
I need to know how can I extract the date of a value if it changed. (Ex: if I fill in A2:A10 some values in 10-6-2024, in A2=55, after 7 days I changed to 66 but I keep the other values without any changes. I need a formula to know only the cells that have changed after the above dat.
Thanks
Hi! Maybe this article will be helpful: How to track changes in Excel.
Hi,
Sorry I have a second part of my question.
I've created a Visual Basic Module, that sends an email reminder to me 1 week before check-in date (A1).
When I 'run' the module from Visual Basic, it works (i.e. sends me an email) - but how/where/what do I insert (formula wise) and where, to tell the spreadsheet to run the module when it gets to 7 days out from the check-in date?
Hi! You cannot run a macro at a specific time using an Excel formula.You can do this with another macro that will check the cell value and run your macro.
Hi! First want to say this article has helped me so much in a number of reports I use so thank you for that! Secondly, I'm having trouble figuring out a conditional formatting formula for the following criteria.
I want to highlight 1 cell based on if a group of other cells has a date that is less than or equal to Today. I've tried a number of formulas and can't seem to figure it out.
Here's an example to better explain:
B1 (Would some type of text)
B2:B5 (These would have various dates)
I want to highlight B1 if any cell from B2:B5 have a date equal to Today or Prior to Today.
Do you know any formula or formulas that would work?
Hi! You can find useful information in this article: Excel conditional formatting formulas based on another cell.
Check the formula below, it should work for you:
=OR(B2<=TODAY(),B3<=TODAY(),B4<=TODAY(),B5<=TODAY())
or
=SUM(--(B2:B5<=TODAY()))
Hi,
Please assist me to get this answered.
I have searched a lot with no results.
I have a column that has dates formulated as 1/15/2016. I am asked to format the cells as Orange if that date falls on a Saturday or Sunday, and if it falls on Monday, to return as "1". How can I do that?
I changed the date format to be (Friday, January 15, 2016), but then I do not know where to go?
Hi! You can change the color of a cell depending on the day of the week using a conditional formatting formula. Use the WEEKDAY formula to do this. For example:
=WEEKDAY(A1,2)>5
However, either manually or using a VBA macro, you can change the date value to "1". Conditional formatting only changes the format, it does not change the value.
Hi
I am wanting to highlight times , that are not :00 , :15, :30, :45 in column C , using conditional formatting only as its an import from another sheet,
i tried using unique but i am a little lost to making this work correctly
eg
Column A B C
Wednesday 06:00 15:31
Thursday 06:00 15:30
Friday 06:00 15:47
Saturday 00:00 00:00
Sunday
Monday 06:00 14:08
Tuesday 06:00 15:30
Hi! Use the MINUTE function to get the minutes from the time. To determine that the minutes are a multiple of 15, use the MOD function. In this case, the remainder of the division by 15 is 0. Create a conditional formatting formula in which the minutes are not a multiple of 15 and the remainder of the division by 15 is not 0.
=MOD(MINUTE(C1),15)<>0
thank you this worked perfectly
Hello. I am working on a five-shift rotation calendar. The calendar covers the whole year. The calendar fills TODAY 's date cell with a chosen color. That works well.
I would also like to fill five cells in the column directly below the date in a different color, to help the Shifts more easily identify who is on duty that day.
I started trying to build a formula where if TODAY was anywhere in the column above, then these cells would highlight. But I can't seem to build a formula that will work.
I wish I could post a Snagit (screenshot) of what I'm trying to accomplish.
For example below, if today's date were 2, I would want the cells to the right of the shifts, below 2, to highlight.
Date Columns
2 3 4 5 6 7 8....
etc...
etc...
Shift A NNNN
Shift B DDD
Shift C TTTT
Shift D DDDD
Shift E NNN
Hi! Suppose the dates are written in row 1 and the data is written in the range B2:F6. Create a conditional formatting rule for the range B2:F6:
=B$1=TODAY()
I recommend reading this guide: Relative and absolute cell references in Excel conditional formatting. Hope this is what you need.
Well, the columns I tried to manually build in my question didn't work out using spaces, and I can't edit it. The date columns should be shifted to right , as well as how D (day shift), N (night shift), and T (training) should line up.
Now i need a help hope you would help me in our office we have a daily tracker in that we have 12 agents and works in 24/7 shifts we work on incident tickets as soon as the ticket arrives we have enter the ticket number in that sheet and change the color of the cell manually according to the time the ticket arrived for eg. if ticket came in between 8am to 9 am it will be green if it is between 9 am to 10 am then red if it is between 10 am to 11 am then purple so on so instead of changing the color manually i need a formula or a steps so based on current time when the data entered into a cell the color should change please suggest
Hi! The above article contains all the information you need, so I hope you will read it. Use the TIME function to set the time. Here is an example of a conditional formatting formula for your question:
=AND(A1>=TIME(9,0,0),A1<TIME(10,0,0))
Create a separate conditional formatting rule for each time interval.
Hello-How would I add conditional formating using an excel calendar template to highlight a Friday that is paydate if comparing to another worksheet that lists the pay dates
Your title - "How to conditionally format dates and time in Excel" - is misleading. You have no examples dealing with formatting time values, just dates. I was looking for a simple way to format times in cells if they are between certain times of the day, say 8:00 AM & 5:00 PM. I can get it to work by storing these two values in some cells and then comparing against these but was looking for a way to conditionally format w/o having to store the two values in cells.
Hi! Since the date and time in Excel are stored as numbers, you can get the time using mathematical functions. For example, using the INT function.
A1-INT(A1)
For conditional time formatting, you can use a formula like this:
=(A1-INT(A1)) > TIME(14,0,0)
actually the other way...5:00 PM & 8:00 AM.
Hi I would like to highlight dates that are less than (X date) and greater than (X) date. I've been successful at highlighting in green (today and future datest) but i cant seem to add the second colour (red) for the dates in the past. Can you please help in how to formulate how to do this.
I will be doing the same formula for other columns that dont have a set previous date but we want to highlight what is expired and what is up to date of the date when the excel report is generated. Thank you!
Hi! You cannot add a second color to a conditional formatting rule. Create a separate conditional formatting rule for each color.
I have a data entry sheet of 3 column. At column B I want to add goods name and at column C the quantity of goods. I want when I add goods name on column B entry date will auto generate on column A. Is it possible?
Hi! If I understand your task correctly, the following tutorial should help: How to insert today date & current time as unchangeable time stamp. The second option is to use VBA to write the current date and time to the cell.
Hello.
Can you please help with the below example. Conditional formatting using 2 dates and 2 times.
Date 1 (F7) and time 1 (G7) - Date 2 (N1) and time 2 (D7) - Highlight F7 if the start date and time is >26 hours after the end date and time
Hi! I don't really understand why you have a start date greater than the end date. To present the difference between two times as a decimal number, read this guide: How to calculate time difference in Excel (elapsed time).
=((N1+D7)-(F7+G7))*24
=(((N1+D7)-(F7+G7))*24)>26
Can you please advise what I am doing wrong here?
I would like to highlight in green dates that are less than 21 days ago from today, yellow 21-40; red more than 40 days agp
I am using the formulas
Green: =Today()-$I3>21
Yellow: =AND(TODAY()-$I3>=21,TODAY()-$I3=45
This appears to be exactly what is pictured in the formulas above & i am not sure why it does not work
It is in order green/yellow/red
Hi! If I understand your task correctly, the following formula should work for you:
Green: =Today()-$I3<21
Yellow: =AND(TODAY()-$I3>=21,TODAY()-$I3<=40)
Hi! I have been tasked to conditional format a cell that did not occur yet, like:
Highlight dates that has not been occurring.
Hi! Compare dates to the current date using the TODAY() function. Read this section carefully: Conditionally format dates based on the current date.
I want to remove from this 2024-01-03T08:25:32.307+01:00 and use time only
Hi! To extract the time from the text, use the SEARCH function to find the number of the position of the letter "T" after which the time is written. Then use the MID function to extract the time and use the TIMEVALUE function to convert the text string into a time value.
Try this formula:
=TIMEVALUE(MID(A1,SEARCH("T",A1)+1,8))
Hi! I have a sheet that has discharge dates. We need to follow up with the patients at 24hours, 1 week, and 15-30 days. I need to highlight blank cells in column b when there is a value in column a based on 24 hours for column b, 1 week for column c and 15-30 days for column d. Formulas I input do not seem to work. Is this possible to have a sheet with this information?
Hi! Your explanations are not very accurate or clear. What does "based on 24 hours" mean for an empty cell in column B? I can try to guess that you need to combine two conditions using the logical AND function. For example:
=AND(A1+1<TODAY(),ISBLANK(B1))
Maybe this article will be helpful: ISBLANK function in Excel to check if cell is blank.
If this does not help, explain the problem in detail.
Hi!
Would you be able to help me with the below?
I want to highlight the date when it's in the last 7 days (which i managed to get =IF($G2<=TODAY()+7) but then if the status (selected from a drop down)in column I = Completed or closed, I don't need it be highlighted as no action is needed
thansk in advance!
Sabine
Hi! If I understand your task correctly, try the following formula:
=AND($G2<=TODAY()+7,NOT(OR($I2="Completed",$I2="Closed")))
Maybe this article will be helpful: IF AND OR statements.
thanks!
I am in sales and i prepared a list of customers. I want to highlight the row that contains the customer name & from august till today the list is increasing. I want that after every 10 days the customers not been contacted can highlight the names that are due to be contacted.
Please help.
Thanks
Hi! If you have a column with contact dates and a column with the date the customer was added, use the recommendations in this article to highlight the names that are due to be contacted.
For example, C1 - contact date, B1 - date of addition:
=AND(ISBLANK(C1),TODAY()-B1>10)
Hi, I have dates in column B, I want to highlight 2 days before date from todays date but dont want to include if holiday or weekend falls in betweek. I want to highlight only working days.
COP Date
9/7/2023
12/4/2023
12/12/2023
12/15/2023
12/12/2023
12/12/2023
12/14/2023
Hi! To count working days between 2 dates, use NETWORKDAYS.INTL function. For example,
NETWORKDAYS.INTL(A1,TODAY(),1)<=2
But you cannot specify how many cells to highlight in conditional formatting. All cells that match the condition will be highlighted.
Hello,
Would you please help me to understand it better?
I have a table from from B10 to Q200 - where Colum K has dates and Colum L has prices.
I need to highlight a row where price ="" and date =In less than 7 days
I'm using this formula, but it only works for 1 row:
=AND($K$10-TODAY()>=1, $K$10-TODAY()<7, $L$10="")
How do I make it work for the whole table?
Please help
Hi! The following tutorial should help: Relative and absolute cell references in Excel conditional formatting. Please use the formula below:
=AND($K1-TODAY()>=1, $K1-TODAY()<7, $L1="")
Hello,
I'd like to set conditional formatting on a cell by % complete within a date rage.
Example would be:
Initial Target Complete  % Complete Status
11/27/2023 100% Blue
12/15/2023 65% Yellow
12/06/2023 30% Red
If within 7 days of target completion date and % Complete is below 50% cell turns red
If within 7 days of target completion date and % Complete above 50% below 76% cell turns yellow
If within 7 days of target completion date and % Complete is above 75% and below 100% cell turns green
If % Complete is 100% cell turns Blue
Any assistance you could give would be greatly appreciated.
Hi! Create a separate conditional formatting rule for each color. For example, for red:
=AND((TODAY()-A1)>7,B1<50%)
For more information, please visit: Excel conditional formatting formulas based on another cell.
I understand how to conditionally format based on a specific date by using it's numerical value. However, how to I set a conditional format based on the whether the date in one column is before or after a date in another column. For example, if one column is the approval date and another is the review date, I want to highlight when the review date is after the approval date. I tried just using B2>D2, but that didn't return the conditioned format.
Hi! If your dates are written as date rather than text, the conditional formatting formula =B2<D2 should work. B2 - is approval date.
I'm trying to get a cell containing a month (listed as 11/01/2023 - 11/30/2023) to turn green if it contains today's date in that whole range of dates. I've already got my initial cell set up with = today() and it's working, but the existing date conditional formatting options are all about being before or after today, and I tried the is equal to today option but it didn't work (i think because I'm listing a range rather than each day in the month separately). I'm thinking I need to use the conditional formatting based on a formula setting but I'm not sure what formula to use. I'm open to putting the first day of the month and the last in separate cells, but listing every day somewhere would be difficult. Any help would be appreciated!
Hi! Specify the month number and select the cells where the date corresponds to this month. Use the MONTH function to find the month number by date.
You can also try the formulas from this paragraph above: How to highlight dates within a date range.
Hello,
i have a sheet containing end date for warranties and i need to creat a conditional formating rule with a formula to indicate when the date is 2 months out.
I have tried =$A2-TODAY()>60 but it does not seem to be working. it is highligning the wrong cells.
How can i solve the issue? Is there a formula that would be better suited for my needs?
thank you!
Hi! In a conditional formatting formula, use the cell reference in the first row, even if the conditional formatting range begins on the second row.
=$A1-TODAY()>60
I am looking to create
Moved to Outcome 1 Month Due Verified Amount
18-Aug-23 18-Sep-23 Y $123.00
25-Aug-23 25-Sep-23 P $456.00
31-Aug-23 30-Sep-23 N $789.00
The values in the cells in the "1 Month Due" column are calculated based on the values in the "Moved to Outcome" column using the "=EDATE (F2, 1)" formula, where F2 holds the "Moved to Outcome" date.
I want to format things so when the value showing the "1 Month Due" column is 1 week past the current date, the cells in the "1 Month Due", "Verified" and "Amount" columns turn orange, and when the date in the "1 Month Due" column is 1 week or more past the current date, the cells turn red.
In addition, I would also like to have the cells the "1 Month Due", "Verified" and "Amount" columns changed based on the value in the "Verified" column.
I have set up the conditional formatting in the "Verified" column so that a cell containing a "Y" turns green, a cell containing a "P" turns yellow, and a cell containing a "N" turns red. I would like this to apply to the "1 Month Due" and "Amount" columns as well, and to override the conditioning based mentioned above (based on the "1 Month Due" condition).
I hope that makes sense, and thanks very much, in advance, for any assistance you can provide - this one has been a real noodle-scratcher for me :)
Hi! Please read the above article carefully. You can highlight a cell with a color if the date is greater than the current date by more than 7 days by using the formula:
=B1-TODAY()>=7
You can also find useful information in this article: Excel conditional formatting formulas based on another cell.
Hello!
I have a matrix for health tests. I can't seem to get past the last month/next month issue. I need anyone who is out of date to go red but cannot work out how to do this past last month (I basically need last month and previous)
Any ideas? :)
Hello! I hope you have studied the recommendations in the tutorial above. Unfortunately, your information is not enough to recommend a conditional formatting formula to you. How do you determine "out of date"? Do you want to highlight with color only the current and last month's dates? Describe the problem in more detail.
I'm looking to pull data from one tab (which is a big list of information) into a summary on another tab. I want to display the name (B2), sub-name (C2) and date due (Q2) within a 21 day window (so it will show everything due within the next 3 weeks, based on today's date). Struggling to find a formula that will do this but I'm sure I've seen it elsewhere before. Thanks
Hi! You can get the data for 21 days using the FILTER function. You can find the examples and detailed instructions here: Excel FILTER function - dynamic filtering with formulas. I hope it’ll be helpful. If something is still unclear, please feel free to ask.
Hi,
I have a spreadsheet containing dates of Insurances.
I have conditional formatting for anything from today to highlight in red. So I know that they have expired.
I am now wanting to add in another conditional formatting for any that are due to expire in the next 2 weeks from 'today' I have tried with a formula of '=AND($D2-TODAY()>=0,$D2-TODAY()<=14)' but is it highlighting insurances that are expiring in 2024.
Please can anyone advise where I am going wrong?
Thanks
Hi! I'm not quite sure what the problem is with this formula. It returns TRUE for a future date no more than 14 days from now. Currently, this conditional formatting formula cannot highlight 2024 dates.
I have a spreadsheet with a list of documents my team needs to review. Whenever the documents are revised, it gets updated on the spreadsheet. I set up the conditional formatting highlight the employees cell green if their review is later than the revision and red if it's prior to the revision. I am facing two problems.
1. If I create the conditions for both in the topmost cell and drag it down to the last cell they all use the first reference cell to compare, even if I take out the $,( i.e. change $B$5 to B5).
2. If I create a CF formula for each cell individually, aside from taking forever, it also returned a different result in the second cell, even though the conditions were exactly the same as the first cell.
Thank you
Hi! Create a condition not for one cell, but for a range of cells: for example, B2:B100. Use the address of the first row of this range in the conditional formatting formula. Read more: Excel conditional formatting formulas based on another cell.
I have a spreadsheet covering events over a 3-month timeframe.
I'd like to highlight rows based on the date the event occurred. There may be one or more rows with one date.
Example: my spreadsheet has 133 rows of data for dates from 01 Jun through 31 Aug. Three rows have events that occurred on 01 Jun; One row with an event that occurred on 02 Jun; No events occurred on 03, 04, or 05 Jun; Eight rows for events that occurred on 06 Jun; etc.
Is it possible to define conditional formatting that will highlight the 3 rows for 01 Jun with a different color that the one row for 02 Jun and yet another color for the 8 rows for 06 Jun?
Hi! For each date, create a separate conditional formatting rule with different colors.
That is not helpful. It'd be faster to filter by date and add color to the rows that appear for each date.
Hi, I am trying to come up with conditional formatting rule that applies to a cell with a completion date that is past the due date listed in another cell. For example, say the "June By Date" is 6/1/23 in cell O3 and "June Completion Date" is listed as 6/9/23, that cell would then be formatted. I am running into the issue of applying this to all rows in that table.
Hi! You can simply compare cells and apply this conditional formatting formula to a range of date cells. For example:
=A1<$D$1
Maybe this article will be helpful: Relative and absolute cell references in Excel conditional formatting.
Hi!
I have put on an alarm sound VBA code and saved it on the spreadsheet that I want to use it for.
The spreadsheet is so that the alarm sound must go off every second day from the dates that I put in. The problem is I don't know what formula to use and how to set it to go off every second day.
Hi! Use the MOD function to determine when the difference between the current date and the date that you put in is an even number.
=MOD(TODAY()-A1,2)=0
I would like to highlight the date in C1 if the date in A1 is more than one calendar month. Not necessarily 30 days. For example, A1 is 01/19/23 and C1 is 02/23/23. Over 30 days are between these dates, but a calendar month has not been skipped, so I do not want C1 highlighted.
Hi! If I understand the problem correctly, use the EOMONTH function to get the date in one month.
try this conditional formatting formula:
=(EOMONTH(A1,1)+1)<=C1
I apologize, I didn't explain what I wanted well. I would like C1 highlighted if a month was skipped. So A1 is a date in January, if C1 is a date in March, skipping February, I would like it highlighted. I tried the YM code, but, alas, it works on days, even though Excel Help said it ignored days and only looked at the month.
Have you tried the formula I gave you? It fits your conditions.
That did work. Thank you!
Hi,
I have a calendar in excel, I need to highlight two cells ( cell 1 = today's date and cell 2 = the adjacent cell below cell 1) been looking how to do this, but cant find an answer. Hope you can help me
Highlighting today's date is quite easy, what I find difficult is highlighting the cell 2
Thank you in advance
Hi! Use this conditional formatting formula and this instruction: Excel conditional formatting formulas based on another cell.
=IFERROR(OFFSET(A1,-1,0)=TODAY(),FALSE)
Use the OFFSET function to get the cell value one row higher.
Thank you very much for your help
Hi
I'm trying to change the cell colour to reflect length of service e.g under 2 years (red), over 2 years (orange) and over 5 years (green).
I am using the following formula to show the service length - =DATEDIF(E2,G2,"y")&" Years, "&DATEDIF(E2,G2,"ym")&" Months" - which shows as 4 years, 2 months. Is it possible to do cell colouring when it has both words and numbers?
Thanks
Hi! Your formula returns text. You cannot compare text to a number of years. Use the DATEDIF function without text, for example:
=DATEDIF(E2,G2,"y") < 2
Hi, I'm working on a project and would like any task end dates (in column L) to highlight red once they're overdue but only if the task status (in column I) does not include the text "Completed". Could you help please?
Hi! If I understand your task correctly, the following formula should work for you:
=(ISNUMBER(SEARCH("Completed",I1)))*(L1How to find substring in Excel
I need to highlight a cell if it is 2+ days past another certain cell. I have a list of dates in different columns and if the date in one column is 2 or greater than the cell to the left of it I want it to highlight. Is this possible?
Hi! Find the difference in days between the dates. For example:
=A1+2
Hey
I want to highlight "tomorrow" in excel. But: when tomorrow is a saturday or a sunday, i want it to highlight the first monday instead
(= i always want to highlight the next working day)
If today is friday 11/08/2023, then i want monday 14/08/2023 to be highlighted
if today is monday 14/08/2023, then i want tuesday 15/08/2023 to be highlighted
can you help me out please?
Hi! For conditional date formatting, try this formula, where D1 is today's date
=(A1=$D$1+CHOOSE(WEEKDAY($D$1,2),1,1,1,1,3,2,1))
For more information, please visit: CHOOSE function in Excel with formula examples
I'm trying to find a formula where the cell turns in different colors:
Each cell has a date (example: 28/04/2016 - typed in cell D3), if 4 years and 6 months passed, it needs to turn orange. But is 5 years passed it needs to turn red.
Can someone help me with the right formula?
Hello! Please try the following conditional formatting formula:
=DATEDIF(A1,TODAY(),"m")/12>=4.5
You can learn more about DATEDIF function in this article: Excel DATEDIF to calculate date difference in days, weeks, months or years.
If i try this, i always get this:
"There's a problem with this formula. Not trying to type a formula? When the first character is an equal ('=') or minus ('-') sign, Excel thinks it's a formula:
* you type: = 1+1, cell shows: 2
To get around this, type an apostrophe (') first:
* you type: '=1+, cell shows: =1+1
Look at the character that separates function arguments in your Excel. It might be a semicolon.
Hello!
I am trying to have a cell turn red if the date is less than or equal to todays date, but I don't know the right formula.
I tried using the conditional formatting rule: Cell Value <= TODAY()
But, when I delete a date from that cell, it still shows a red fill color and I don't know how to remove it. Is there any way to remove the color if the cell is blank or do I need a different formula?
Thank you so much for your time!
Hello! Add another condition to the conditional formatting formula using the OR logical function.
=OR(D1<TODAY(),NOT(ISBLANK(D1)))
or
=OR(D1<TODAY(),D1<>"")
I need to highlight cells based on its value (date), to identify whether thats expired or not ;
where expiry criteria defined in a single master cell of that column (i.e. 2 years, 1 year etc)
For example
H column is representing a course
H100 = "1-JAN-2022"
Expiry of H column items (course validity) is in cell H3 = "2 Years"
There will be many rows of H, as well as other columns to mark validity in the same format
Can anyone guide?
Hi! You cannot use cell H3 for calculations because it contains text, not a number. If a number of years is written, you can use the DATEDIF function to calculate the difference in years.
Here is conditional formatting formula example:
=DATEDIF(H100,TODAY(),"y")>H3
Hi
Im looking for a function to do the next.
every 15th of the month I want a specific cell to decrease by 1 permanently.
all the things I tried turned back to the origianl once the date turned to the 16th.
please help
tnx :)
Hi! If I understand your task correctly, you can count the number of months from a certain date, for example from 15 Apr 2023, and add it to the cell value. Every 15th day this formula will increment by 1. For example,
DATEDIF(D1,TODAY(),"m")
Look for the example formulas here: Excel DATEDIF function to get difference between two dates.
I am looking to make a worksheet that will highlight a date if it is earlier than a specific date of the month. For instance, we have a check to do every month from the 16th of every month. I would like to be able for a cell to turn red if the date in it is earlier than the 16th of that month
Hi! Create the target dates with the DATE function. Get the current month and year using the MONTH and YEAR functions.
If I understand your task correctly, try the following formula:
=AND(D1=DATE(YEAR(D1),MONTH(D1),1))
Hi, Alexander, Who how link the second excel data to the first excel, when I update the new date? immediately, just change only a week.
Hi! Maybe this article will be helpful: Excel reference to another sheet or workbook (external reference)
Great information - but stops short of helping the beginner with coloring cells with date/time and leaving cells with text (PENDING) white. Would be really helpful if you explored the basic techniques for beginner to be able to master conditional formatting a cell to a color if there is a date time (period) vs. having the word PENDING. This complex issue is not covered, and when records are processed based on random date/times throughout the day you need to be able to highlight them. Hopefully, someone will report how to do that so I can apply it at my job. There is never training provided and receptionists are being tasked with more complex tasks daily. Would love support on this stuff. Thanks,
Hi! You can use the CELL function to determine if a cell has a date in it. If I understand your task correctly, try the following formula:
=LEFT(CELL("format",A1),1)="D"
Probably a long shot but I'll ask! I'm using a =NOW() function to track the time elapsed, basically like a stop watch/stop the clock tracked in a spreadsheet of values. Currently formatted with =TEXT(CurrentTime-C10,"hh:mm:ss"). Two part question: The biggest question though is, is there a way to highlight the cell once 10 minutes, 20 minutes, or 30 minutes have elapsed without using a macro? I've tried using the time formatting and the lowest you can get is by day, not by minutes.
part two: This sheet is used by both US/UK employees, so one side sees it displayed in each time zone, but when dates are entered, it only tracks in the UK time frame. (Example: Time input in UK BST as: 10:13, elapsed time should be 11:08 (which is what UK employees see), but US employees see 19:11:08, based on the time zone and the =NOW. Is there anyway to format that better?
Hello! If you write the time as an unchangeable timestamp, you can apply conditional formatting to these cells using a formula:
=AND(C1<>"",(NOW()-INT(NOW())-C1)>TIME(0,30,0))
I recommend these guides on how to write the time in a cell: How to insert current time in Excel: timestamp shortcut, formula, VBA and How to insert today date & current time as unchangeable time stamp.
If I understand the second question correctly, you may find this tutorial helpful: How to create a custom Excel date format for another locale.
I hope it’ll be helpful.
Thank you so much for your quick response, I will give both these guides a look and try your formula!
I am tracking attendance and I want to show a two year rolling date range. Meaning after two years the absence is no longer in their file. Once the absence is "out of range" I want it to no longer be on the spreadsheet. Additionally I want the recent 12 months one color and the subsequent 12 months a different. How do I format that?
Hi! To highlight dates greater than 12 months from the current date, you can use the conditional formatting formula with the DATEDIF function
For example,
=DATEDIF(A1,TODAY(),"m")>12
You cannot use Excel formulas to delete any data from the worksheet. You can do it manually or with a VBA macro. You can use an Excel filter to hide unnecessary data.
Trying to format a spreadsheet - work in doctors surgery.
Spreadsheet contains name, nhs no, date of death, date of birth, age and 6 other columns - I want to highlight a row based on the date of death being in the past month but whatever I use either highlights only the date of death cell or the whole spreadsheet.
Help please
Hi! Highlight rows starting from row 2 and below as needed. Create a conditional formatting rule for the selected rows using a formula:
=MONTH(TODAY())-MONTH($C2)=1
You can learn more about change the row color based on cell value in Excel in this article on our blog.