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 33. Total comments: 1243
hi SVET, I want only fridays as a weekend of the month, any solution using conditional formatting, your given example is for 2 days weekend and it's sat and sun. i tried this formula =WEEKDAY(DATE($C$3,$C$2,C$5),1)>6 but it was Saturdays being hi-lited, what i want is the fridays only, i tried more formulas but i failed. suggestion please.
Dear Concern,
kindly let me formula for finding days like if today is Monday so after 61 days what will day come?
Hi,
Is there a way to automatically fill dates to show only Monday, Tuesday, Thursday, Friday. For example, using the fill weekday option but removing Wednesday in every row.
What I want to do is to show the following but to auto fill the dates for the whole year without Wednesday, Saturday and Sunday.
5/1/15
6/1/15
8/1/15
9/1/15
12/1/15
13/1/15
15/1/15
16/1/15
etc.
Thank You
I currently have this formula:
=AND(TODAY()I2,LEN(K2)=0)
The formula works perfectly, but it only works one time. I need the formula to reset when I change the dates for G2. When I change the date for G2, it changes H2 and I2.
J2 is highlighted for the dates between H2 and I2, but it isn't highlighted when I type in a date in K2. However, I change the date in G2 every 60 days and it doesn't reset the formula to work again. Any help would be greatly appreciated! Thanks!
I have a column with various dates [column b]. I want cell B1 to populate the next date in column B after today's date. Cell A1 is =today() for today's date. Column B has dates based on a 64 day cycle starting in 1977 all the way to 2050. I want B! to show the next date after today in the 64 day cycle. Thank you for your help. Great site!
I inherited this sheet from some one with format cell that can only accept date in particular month and year. please how can undo it. the cell has been format to accept 01/01/14 and this 2015 but it will not accept 01/01/15, it comes back telling me that I can only input date within this month.
I am tryimg to write a formula that says if the value of a specific cell is a 1 or 2, add 60 days to the date of another cell and place that date in a third cell. but if the value is 3 add 30 days to the date.
So if A1 is a "1 0r 2" take the date in cell A2 and add 60 days to it and place the value in A3. If the value of A1 is a 3, take the date in cell A2 and add 30 days to it and place the value in A3
Hi Mike,
The following nested IF formula works a treat. Just copy it into the cell A3 and check if it returns the result you want:
=IF(OR(A1=1,A1=2), A2+60, IF(A1=3, A2+30,""))
Please make sure the cell A3 has the date format (you can simply copy the format of A2 into A3).
Also, if the cell A1 contains any value other than 1,2 or 3, the formula will return an empty string.
hello swetlana,
i want to highlight my dates three days before into green and into red after date is expired.
thnx in advance.
i want to highlight my dates three days before, how can i do it pls..
Hello, I can't figure out solution to my problem. I have a table with increasing date rows like this:
Date Value
3.11.2014 356540
4.11.2014 356757
4.11.2014 356758
4.11.2014 356762
5.11.2014 356793
6.11.2014 356833
6.11.2014 356838
Is it possible to format that table so the colour of font (or whatever) changes randomly after every change of date. So the rows with same date will be differently highlighted? Thanks in advance, T
Hello:
I've done this before but, I am blanking on the excel formula that I used. I am trying to make an excel spreadsheet to remind me when my staff are in need of training based off days.
example
Green colored cell 12/12/2014 - 9/12/2015 Training is up to date
Yellow colored cell 9/13/2015-12/11/2015 Training is about to expire
Red colored cell 12/12/2015 Training is expired
Please help and Thank you
Very Respectfully,
John
Hi,
I need help with conditional formatting. I have two columns that have dates. e.g. Col A (Entry Date) has date 02 December 2014. Col B (Exit Date) has date 01 December 2014. I want conditional formatting in all the cells in Col B when the date is less than the date in Col A.
Hope it makes sense.
Many thanks,
Sam
Hi Samuel,
Select column B and create a conditional formatting rule using this formula:
=B2<A2
Assuming that row 2 is your first row with data.
Hi I have been using the following formulas however for some reason it highlights the cell above not the cell with the date in it. =AND($A2-TODAY()>0,$A2-TODAY()<=30)
Hi Teri,
Using A2 in the formula implies that row 2 is the 1st row in the range to which the rule applies, please make sure it is really so. If you want to apply the rule starting with row 1, then replace $A2 with $A1 in the formula.
Hello,
How can I get something like this
29/11/2014 00:00
29/11/2014 00:15
29/11/2014 00:30
29/11/2014 00:45
29/11/2014 01:00
And so on, to get after 96 quarters 30/11/2014, and afterwards 01/12/2014?
Thank you in advance!
Hi Siva,
If you need to have time with a 15-minute interval, please do the following:
1. Enter the starting time in cell A1.
2. Type this formula =A1+1/(24*4) into cell A2.
3. Apply the Date format to cell A2 identical to A1.
4. Copy the formula from cell A2 down to the other 94 rows.
Good morning, Svetlana.
I want to duplicate the date from A11 into D11 (A12 into D12, A13 into D13, etc.) without viewing the "1/0/1900" default throughout the spreadsheet. I believe I need to use an If/Then rule, but I have yet to find the correct formula. I used =IF(COUNT(H15)=1,K14-H15,"") for another set of cells, in order to keep the spreadsheet clean, as opposed to viewing default "#VALUE!". Can you help with my date dilemma??
Thank you, in advance!
Hello,
I need help with trying to color coordinate a total based on which day of the week it is. The color needs to change based on the total in the cell.
PLEASE HELP.
thanks!
Hi,
Can someone please let me know if this is possible:
Change the shade/color of the cell based on WHEN the value changed? For example, I have a cell with a drop down menu. Is there anyway I can highlight that cell if the value of that drop down menu hasn't changed in 2 weeks? Note that field in the cell is NOT a date, it is simply a text string.
Thanks!
Hello Shahbaz,
Regrettably, formulas won't help you with your task. Most likely you need a special VBA script.
That's what I figured, thanks.
Hi,
I have several rows filled with dates and I am looking for them to turn yellow when the date is 30 days away and red when the date has lapsed, I seem to be able to do this for a month at a time using the "conditional formatting" button but after the last month has passed it returns to its normal colour, in essence if the date is longer than one month in the past it will not highlight it. could I have a formula that will lengthen this time frame, a year or two would be helpful.
Thanks
I would like to make cell E4 put an X in the cell when cells F4:J4,L4,N4,U4,X4:Y4 have a date put in their cell.
I have a spreadsheet to track training and E4 will show me that the orientation training has been completed should the other cells have a date in them.
I was trying to use an IF function like this, however, the X will not remove if the date is deleted from the cells.
=If(F4:J4,L4,N4,U4,X4:Y4=DATE),"X"," ")
is there a better function to use?
I have also tried to use conditional formatting but am unfamiliar with excel at this level.
Thanks.
Hello Josh,
The shortest formula will be as follows:
=IF( IFERROR(F4*G4*H4*I4*J4*L4*N4*U4*X4*Y4,0) >0, "X","")
For the conditional formatting rule, you can use this formula:
=IFERROR(F4*G4*H4*I4*J4*L4*N4*U4*X4*Y4,0) >0
If you need to check each cell for the date, not simply for the number, I am afraid, the formula would be too long and complex.
Thank you!
Respected sir,
How calculate ( old date + current date )in ms excel.
I need my staff working days calculate daily automatically...
Thanks For advance
Hello AKBER,
Just enter =A2+B2 and apply the Number format to the cell with the result.
Or, you can use the datedif function to count the number of days between the dates:
=datedif(A2,B2,"d")
I am creating a spreadsheet that tracks the date a Patient STARTS a treatment in column F2-F20 and when a Patient STOPS treatment in column G2-G20. What I need is for column G2-G20 to highlight YELLOW when 5 days from the END of treatment and then highlight RED when treatment is done or past due. Example: "Big Bird" starts treatment on 11/15/2014 (entered in Cell F2) and his treatment ends on 11/29/2014 (entered in Cell G2). 5 days before 11/29/2014 Cell G2 should highlight in YELLOW and then on 11/29/2014 and after the Cell should highlight RED. Thank you for your time and help SVETLANA!
I have a date(3-Nov-14) and the value in another column.Next month, i need to pick up the other value.
Could you please help me out with the formula.
Ex:- 03-nov-14 0.366
01-Dec-14 1.36
Thanks
Sirish
I'm going to create a Drop down box in excel, I have set of data (each data have single cell) followed
100 Sales
200 Finance
300 IT
400 Marketing
500 Safety
From this I need to display number only (eg. 100) My request, when I select 100 Sales, cell will display only the number 100, How it is possible to get.
we need to use data validating and conditional formatting. please help me.
Hello Naina,
First off, let me check if my understanding of your task is correct. You have a dropdown list with entries like "100 Sales", in some cell, say A1. And you want to display "100" in another cell, say B1 when "100 Sales" is selected in A1.
If so, just enter the following formula in cell B1, which retrieves the values from A1 until the first space:
=LEFT(A1,FIND(" ",A1))
Thanks for your reply.
Is it possible to display in check box itself. Eg. If I select the check box text "100 Sales" after selecting It should be display "100" only. because this is for printing purpose, I need the numbers only 100, 200, 300 remaining's are reference purpose. otherwise any other option to do this.
Note: I need the numbers only, corresponding word only for reference not for print. I hope you will be understand this.
Thanking you and I'm waiting for your reply!
Hi,
Conditional formatting is much interesting. Can u plz tell me how to sort out the contents present in one column with the contents present in another column. I wants to highlight the contents present in one column only which are different from the contents present in another column. How can I do it?
Waiting for your reply
Regards,
Farhan Khalid
Hello Farhan,
You can create a rule to highlight cells in column A whose values are not the same as in column B with this formula:
=A2<>B2 (assuming that row 2 is your first row with data)
Hi Svetlana,
I'm hoping you can help - you seem to be extremely knowledgeable when it comes to Excel and conditional formatting - Very advanced stuff!
I'm trying to set conditional formatting where the dates in the future so they will turn automatically in a particular colour, more than 2 months green, 2 months and less (amber) and 1 month and less (red).
I can't seem to find it in the formula drop down list for these particular timescales.
Your help will be very much appreciated.
Let me know if you need any more info.
Many thanks again
Vincenzina
Hi Vincenzina,
Regrettably, you cannot create a rule that will work based on months, since the number of days in each month varies.
Alternatively, you can create the rules based on the number of days, like these:
Green (in more than 60 days): =$A2-TODAY()>60
Amber (in 60 to 31 days): =AND($A2-TODAY()>=31, $A2-TODAY()<=60)
Red (in 30 days and less): =AND($A2-TODAY()>=1, $A2-TODAY()<=30)
The current date and past dates won't be colored.
Hi Svetlana,
many thanks for your swift reply.
I have tried to set this formula but it I get an error message saying 'You cannot use relative references in Conditional Formatting criteria for colour scales, data bars and icon sets.
Is there another way I could set the formatting?
Many thanks
Vincenzina
Hi,
Sorry, I managed to figure this out.
Many thanks again!
Vincenzina
Greetings Svetlana,
Your tips are very helpful! I've been trying unsuccessfully to add one of the previously explained formulas to a spreadsheet I have, but no luck.
I'm in need of a formula that I can use with custom colors. I added the =TODAY() to my A1, which gives me today's date every time I open it. Now what I'm trying to do is add 3 different colors to a cell lets say "I4".
From today's date to 90 days = custom color; from 91 to 120 days = custom color; and from 121 to 180 days = custom color all of them within the same cell. Hopefully, I explained myself correctly and any info you can provide will be greatly appreciated. Thanks in advance!
Regards,
Ivan
Hello Ivan,
Try creating the rules for I4 with these formulas:
From today to 90 days (including today): =AND($I4-$A$1>=1, $I4-$A$1< =90) From 91 to 120: =AND($I4-$A$1>=91, $I4-$A$1< =120) From 121 to 180: =AND($I4-$A$1>=121, $I4-$A$1< =180) Instead returning the current date in A1, you can use the TODAY() function directly in the formulas, e.g. From today to 90 days: =AND($I4-TODAY()>=1, $I4-TODAY()< =90)
Hi
Thanks for the very helpful information you publish. I've been trying to work out how to do a specific task in XL2013 and seem to keep mucking it up. please help me
I have a mix of dates spread across many rows and columns. Based on the =today() I what to format as follows
any date from today to 36 months ago to be green
any date from 36 months ago to 60 months ago to be yellow
any date greater than 60 moths ago to be red.
i keep getting errors and not all colours showing
I also have a problem with all empty cells being coloured and i would like them to stay white.
Can you please help me
Thanks in advance
Kevin
Hello Kevin,
I don't know a way to create a rule that will work based on months, since the number of days in each month varies.
Alternatively, you can create the rules based on the number of days, like these:
Green (from today to 36 days ago): =AND(TODAY()-$A2>=0, TODAY()-$A2<=36)
Yellow (from 37 to 60 days ago): =AND(TODAY()-$A2>=37, TODAY()-$A2<=60)
Red (more than 61 days ago): =$A2-TODAY()>=61
I don't think this has been answered here.
What if you want a range of cell each with a range of different dates yet you want them all follow the same rules regarding their change in colour leading up to the date specific related to each individual specific cell?
So one cell may have a date of 1/1/15 and another may have a date 20/1/15 they may turn different colours as you get closer to the date each time you open up the spreadsheet, but the earlier date will change colour sooner than the later one.
Hello Oliver,
You can achieve this by creating a few rules with different colors for your dates. For example:
Yellow (due in 1 to 20 days): =AND($A2-TODAY()>0,$A2-TODAY()<=20)
Red (due in 21 to 40 days): =AND($A2-TODAY()>20,$A2-TODAY()<=40)
And so on.
Hello Jill,
If the expiry date is calculated based on the current date, you can write the formulas using the Today() function:
Red:=$A2<TODAY()
Yellow (expires in 1 to 30 days): =AND($A2-TODAY()>0,$A2-TODAY()<=30)
or
Yellow (expires exactly in 30 days): =$A2-TODAY=30
Green (expires in 30 to 60 days): =AND($A2-TODAY()>30,$A2-TODAY()<=60)
or
Green (expires exactly in 60 days): =$A2-TODAY=60
I am creating a matrix to track training tickets. I need the matrix to tell me when tickets will expire,(expired, 30,60) I will then need to add the red color to the expired tickets, Yellow to tickets that will expire in 30 days, and Green for tickets that will expire in 60 days.
Can you help out.
Good morning,
My sheet allows us to ensure steps are completed in a allotted amount of time. I have set-up a template to track each inspection for easy viewing for our boss.
We input the date when the inspection begins and then the other dates are auto-populted by a simple formula I put into the cells.
I would like to change the color of the auto-populated cells to yellow, if the phase is being worked within the time constraints and red if the items have not been completed within the time constraints. Then once it is completed, we type complete in another cell, in a different row, and I would like to change the cell with the date to green based off the cell with the wording. (I hope all of that made sense)
What is the best way to change the colors.
The first phase starts 28 days before the inspection and needs to be completed 21 days before the inspection. The second step starts 21 days before the inspection and ends 7days before the inspection, so on and so one.
The dates are in row 5 and the information that will state completed is in row 9.
Any help would be greatly appreciated.
Hi Svetlana, Can you please help me?
I have 2 columns (B&D) that have dates in them and I want column D to turn green if column B is column D. I got the red condition code set up correctly but the green condition code (=B8<=D8) works to a point. If column B does not have any data in it, it still turns column D green. How do I fix this so if column B is blank column D will not highlight? Thank you!
Jeff
Never mind I found the answer. Here is the formula I used:
=$B2>DATEVALUE("1/1/1990")
Hi I'm wondering how can I format an excel that cell should be highlighted if it expired. But expiration will be automatically recognized every year.
I have here the situation..
Date hired is May 26, 2008. under this date is different topics. Each topic should be reviewed every year based on their month and day anniversary.
May 26, so I should be reminded that this person will be needing to review topics for this year on or before may 26. Condition: Year of entry to cell should be same year and within the year if not highlight will stay and highlight will effect if it's passdue or overdue like 2014 now but year typed is 2015. Thank You.
Hello
I coulod really use your help!
I'm migrating data from one excel spreadsheet to another and have a problem with the dates.
In one of the files, the date column only has the year, the other file has a complete date with the format dd-mm-yyyy.
I need the cells that only have the year to have the same format and since there is no information on the month and year, these would show as zero.
i.e.
00-00-2014
Do you know if this is possible and can you help?
Thank you!!
I could really use some help. I'm sure the answer is simple but i cant figure it out. I am working on a billing tracker for 6 month contracts. I dont know how to get the day to change in the date so it corresponds with the monthly billing. So contract start date is 9/15/2014. Billing date is the 5th, 10, 15th or 25th of each month. they pick. I have the drop down menu set up so i can select the date they choose but i need it to show that the first billing date is 09/25/2014 and then in the next column to show 10/25/2014. I can only get it to copy the start date and show that x months out but i cant seem to see how get the day to change according to the bill date. Thank you for the help!
Thanks for that Svetlana.
I have 300+ operative all of whom have had training for various courses and all of which expire at different times so I require something to help track when they are close to expiring and once they are they have expired.
The forumla I had used was:
=$B$2-45<TODAY() To change to orange 45 days before certificate had expired
=$B$2<TODAY() To change to red once certificate had expired
Thanks for any help in advanced I use excel regularly to create tables and charts but am really not familiar with formulas.
Hello Robert,
The problem proves to be in cell references. Your formulas are correct, just use $B2 instead of $B$2 (absolute column and relative row references) so that Excel can correctly apply the rules to all cells.
You can find more information about cell references in conditional formatting rules in this article:
Absolute and relative cell references in Excel conditional formatting
I have got a vast spreadsheet giving various dates of when peoples certificates are due to expire,I have got two formulas I wish to use one notifying me 45 days before the expiry date given and then another one once the date has been passed. I am able to get this to work for an individual cell but I am then unable to transfer this across the rest of the cells without doing them all individually. I have tried to use format painter but that does not carry over the conditional formatting.
Hello Robert,
If you want your conditional formatting rules to get applied to the entire column, e.g. highlight all the dates in column A that meet the conditions, then select the range of cells you want to color, say A2:A100 and re-write your formulas for the first of the celected cells using absolute column and reletive row references, e.g. $A2.
If you want something different, please give me more details about your data structure and the formulas, and I will try to help.
Great article! I really suggest if the reader is unfamiliar with conditional formatting, start with the beginning examples and work your way down to functional solutions for more complicated problems. Thank you!
Thank you for your kind words, Chris! I am happy to know my article was helpful.
how can i create in excel that make expire date for one week in red mark
Hello shoukath,
For me to be able to suggest a proper formula, please provide more details about what is deemed an expired date.
If it is simply more than 7 days back from now, then you can use this formula (where A2 is the first cell with data):
=TODAY()-$A2>7
If you want something different, please clarify.
I have some dates in column B. In column A, I would like 15 days before one text will show like "LC need". Is it possible by a conditional formula? Pls help me.
I have a set of dates... I need to change the date color if today - 2 days one color, and 2 days back to 5 days back one color, 5 days back to 7 days back one color, more than 7 days back one color, How its possible to do? Please
Hello Naina,
You can do this by creating a set of conditional formatting rules with the following formulas (where $A2 is the first cell with data):
Today to 2 day back:=AND(TODAY()-$A2>=0,TODAY()-$A2<=2)
3 days back to 5 days back: =AND(TODAY()-$A2>=3,TODAY()-$A2<=5)
6 days back to 7 days back: =AND(TODAY()-$A2>=6,TODAY()-$A2<=7)
more than 7 days back: =TODAY()-$A2>7
It's Working good, Thank you very much
Hi need help how to resolve this formula... it always end in #VALUE! error because of N/A and A word... Thanks!
=IF(I42=3,I42*3*12,IF(I42="N/A",0,IF(I42="A",0))))
Hi
I have been trying out the formulas but i just cant get what i wanted. im trying to keep track on deliveries and need a warning before the actual delivery date.
Cell A1 = todays date
i want it to be:
orange : 15 days before date(or any number of days i can modify to)
yellow : on the day itself till
red: after 15 days onwards
thanks.
Hi Joey,
Select the dates you want to format, say in column B, and try creating the rules with the following formulas, where B2 is the top-left cell of the selected range:
Yellow: =AND($B2>=$A$1, ($B2-$A$1)<15)
Red: =$B2-$A$1>=15
Orange: =$A$1-$B2=15 - exactly 15 days before the date
or
Orange: =AND($B2<$A$1, ($A$1-$B2) <=15) - from 1 to 15 days before the date
wonderful. perfectly working. thanks alot!
Hi
I have a date in Cell c2, I would like cell g2 to have a red icon appear when todays date is 49 years and 6 months after the date in c2.
I would also like cell h2 to have a red icon when todays date is 59 years and 6months after the date in cell c2
Hello
I want to highlight my cells in different colours depending on the date. For example (and I'm using British dates sorry) if I have cell 1A with a date 17/10/2014 I would like it to become yellow three months after the date and red six months after the date.
Thankyou very much
Hello Finlay,
Sorry, I don't know a way to calculate exactly 3 or 6 months because the number of days varies from 28 in Feb to 31, say, in Dec.
Instead, you can highlight dates based on the number of days after a certain date. For example:
Red (after 180 days): =TODAY()-$A2>=180 (it should come 1st in the rules list)
Yellow (after 60 days):=TODAY()-$A2>=60
Hello,
I am trying to colour code for various dates and can't seem to get the formulas to work. The intent it to show any date that is equal to today (or in the past) as green, dates within the next 30 days as yellow, dates 31-60 days as orange, and anything 61 days or longer as red. I have tried creating a new spreadsheet as well as leveraging an existing one, and can't get the formulas you show above to work as a test. Any advice and assistance would be greatly appreciated.
Hello Cody,
Try creating the rules with the following formulas (assuming that your dates are in column A and row 2 is the first row with data):
Green: =$A2<=TODAY()
Yellow: =AND($A2>=TODAY()+1,$A2<=TODAY()+30)
Orange: =AND($A2>=TODAY()+31,$A2<=TODAY()+60)
Red: =$A2>=TODAY()+61
1) How do you copy an upcoming date to a different cell from a series list of 26 Dates ie starting from a set date (28/7/2015 – 30/6/2015, cells B2:B27) and showing the next highlighted upcoming date in the series list and only that date (ie every 14 days from starting date (say 14/7/2015 showing a highlighted 28/7/2015 in cell A3) then show the following next date in the series list (12/8/2015 again in A3) when the preceding next date in the series list is reached (28/7/2015 in A3).
Can someone help me with the formula of picking the highest number settlement on a weekly basis with data that shows multiple amounts settlemend on a daily basis
Hi Sam,
Please give us more details, i.e. what columns you have and what kind of values they contain (data sample would be even more helpful), and will try to help.
I have a spreadsheet with a constant date in D8. Then I have dates calculated based upon that date. I need a formula that counts 10 days from that date, but if it falls on a Saturday or Sunday, then I need Monday's date to appear.
I will also have to work in a holiday table so that if it falls on a holiday, then the next day after the holiday should appear.
Might you help?
Hello Monica,
You can use the following WORKDAY.INTL function:
=WORKDAY.INTL(D8,10,1,A17:A30)
Where A17:A30 is the range with your holiday dates.
You can find more information about the WORKDAY.INTL function in this article:
https://support.office.com/en-US/Article/WORKDAY-INTL-function-0979878c-f476-4dc7-aa81-47111caa9c8a?ui=en-US&rs=en-US&ad=US
In some Excel work sheets i am trying to insert rows, but the insert row option is disabled, but the option is enabled on on some some sheets. whats the probelm?
Most likely these worksheets are protected. To check this, select the sheet, then go to Review > Protect Sheet.
n excel file, when i am trying to move one sheet from one file to another excel file it shown a message as
"A formula sheet you want to move or copy contains the name 'sss', which already exists on the destination worksheet. Do you want to use this version of the name?
* To use the name as defined in the destination sheet, click yes.
* To rename the range referred in the formula or worksheet, click no, and enter a new name in the conflict dialog box."
it ask the same question 20 to 40 times to move a sheet.
and after move the sheet and make changes and save it with another file name and close it. when i open the same file the format totally distrubed just shown text with format.
Sorry, I've never run into a similar issue and therefore cannot advise anything.