Note: The other languages of the website are Google-translated. Back to English
English English

How to conditional formatting based on date in Excel?

As we known, the Conditional Formatting can auto change cell format based on the cell contents. This tutorial, I will introduce how to conditional formatting cells based on date in Excel.

Conditional formatting dates equal to/greater than/older than TODAY

Conditional formatting past dates

Conditional formatting future dates

Conditional formatting between two dates

Conditional formatting based on date in another column


Conditional formatting dates equal to/greater than/older than TODAY

To conditional formatting dates, you need to create a new rule.

1. Select the cells you want to add the conditional formatting, click Home > Conditional Formatting > New Rule.
doc conditional formatting date 1

2. In the New Formatting Rule dialog, select Use a formula to determine which cells to format in Select a Rule Type section, then choose one formula as you need to type in Format values where this formula is true text box.

  • equal to today:=$B2=TODAY()
  • reater than today: =$B2>TODAY()
  • Older than today: =$B2<TODAY()

doc conditional formatting date 2

3. Click Format to go to Format Cells dialog, select one format you want to highlight the cells as you need.
doc conditional formatting date 3

4. Click OK > OK. The dates have been formatted.

Note: Today is 15/8/2018
doc conditional formatting date 4


Conditional formatting past dates

If you want to conditional formatting the past dates, you can do as follows in the New Formatting Rule dialog.

1. Select one of below formulas as you need, and type it into the Format values where this formula is true text box.

  • More than 30 days ago: =TODAY()-$B2>30
  • From 30 to 15 days ago, inclusive: =AND(TODAY()-$B2>=15, TODAY()-$B2<=30)
  • Less than 15 days ago: =AND(TODAY()-$B2>=1, TODAY()-$B2<15)

2. Then click Format to select one format in the Format Cells dialog.

3. Click OK > OK to close the dialogs.

Note: Today is 15/8/2018
doc conditional formatting date 5


Conditional formatting future dates

To conditional formatting future dates, you can do as these:

1. Select one of below formulas as you need, and type it into the Format values where this formula is true text box.

  • Will occur in more than 30 days from now: =$B2-TODAY()>30
  • In 30 to 15 days, inclusive: =AND($B2-TODAY()>=15, $B2-TODAY()<=30)
  • In less than 15 days: =AND($B2-TODAY()>=1, $B2-TODAY()<15)

2. Then click Format to select one format in the Format Cells dialog.

3. Click OK > OK to close the dialogs.


Conditional formatting between two dates

To conditional formatting between two dates, select the cells and use this formula, =AND($B2>=$D$2,$B2<=$E$2) D2 is the start date, E2 is the end date. Then format the cells with a format you need.

doc conditional formatting date 6
doc conditional formatting date 7

Conditional formatting based on date in another column

If you want to conditional formatting cells based on the date in another column, you can do as these.

1. Supposing you want to highlight sales in column C while the relative dates in column B is 16/8/2018, please select column C range firstly.

2. Enable the New Formatting Rule dialog and type this formula =$B2=DATEVALUE("8/16/2018") into the Format values where this formula is true text box, then format the cells in Format Cells dialog.

doc conditional formatting date 8
doc conditional formatting date 9

Note: In the above formulas, B2 is the first date cell of your selected date range.



The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hola. Muchas gracias por la información, es justo lo que estaba buscando pero... no funciona la fórmula cuando la incluyo en el excel, me sale un mensaje de error. No sé si es porque está en inglés y mi excel está en español, pero no sé cambiarla a formato castellano. Gracias!
This comment was minimized by the moderator on the site
Gracias por su mensaje, lamento mucho que esta fórmula solo se pueda adaptar a la versión en inglés de Excel.
This comment was minimized by the moderator on the site
Ich habe in einer Spalte drei Datumsangaben (C,F,G) und möchte Spalte A rot färben, wenn mindestens eins davon älter als heute ist. Wie stelle ich das an?
This comment was minimized by the moderator on the site
Hi, I do not know German, if I misunderstand your problem, thanks for your pardon.
My understanding is to color the cell in A column, if one of the cells in column C, D, G is less that the value Today.
Firstly, in cell A1 using the formula =IF(OR(C1<TODAY(),D1<TODAY(),G1<TODAY()),"Yes","No") which will return Yes if one of the cells in C1, D1 and G1 is less than Today, return No if all of the cells in C1, D1 and G1 are greater than Today.
Then, select the cell A1, and click Home > Conditoonal Formatting > Highlight Cells Rules > Equal To, and type Yes into the textbox, and click Custom Format in the right drop down list to choose red fill.
Now if any cell (C1, D1, G1) is less than Today, the cell A1 will be colored with red.
This comment was minimized by the moderator on the site
Bonjour, j'ai téléchargé un document excel pour la gestion des congés: Shift staff. Je voudrais que certaines dates soient conditionnées pour rester inactives chaque année (il s'agit des congés légaux comme le 1er janvier ou le 15 aout) - actuellement je ne peux conditonner que les jours de la semaine, pas les dates - pouvez-vous m'aider?

Merci beaucoup

Pascale
This comment was minimized by the moderator on the site
Bonjour,
je cherche dans GOOGLE SHEET à faire une mise en forme conditionnelle par rapport à une date; je cherche à faire en sorte que quand la date inscrite dans une case dépasse 15jrs alors elle devienne rouge. (01/08/22 dans la case, quand nous sommes le 16/08/22 je voudrais que la case devienne rouge)

merci d'avance.
This comment was minimized by the moderator on the site
Hi, vex, sorry that I only can reply with English since I do not know French. Supposing you want to format all dates that over 15 days based on a date 7/21/2022, you may firstly, change the date 7/21/2022 to a number, 44763, then select the dates that you want to highlight, click Format > Conditional Formatting, and choose Custom formula is in the Format Rules section, type B2>44763+15, and choose red color. See the screenshot:
https://www.extendoffice.com/images/stories/comments/sun-comment/doc_google_sheet_conditional_formatting.png
Hope can help you.
This comment was minimized by the moderator on the site
ERP PO No. Region Update-1 Supplier PIC Note To Receiver PO Age
1091BPA6438143-121 Bali - Lombok Not Yet Implement PS2MS XL 31
1091BPA6438143-123 Bali - Lombok Not Yet Implement Lumpsum 31
1091BPA6438143-124 Bali - Lombok Not Yet Implement Service Package 31
1091BPA6438143-125 Bali - Lombok Not Yet Implement Battery Maintenance 31
1091BPA6438143-127 Bali - Lombok Not Yet Implement MS Dismantle Board 22

kalau cara conditional formating untuk PO aging Lebih dari 70 gimana ya, tapi di file pivot, karena database saya untuk po aging 70 itu pake rumus =IFERROR(DATEDIF(NOW();B56;"d");""&DATEDIF(B56;NOW();"d")) jadi saat saya conditional formating aging lebih dari 70 dengan warna merah itu tidak ke detack di pivotnya,
mohon bantuannya😁
This comment was minimized by the moderator on the site
Hola!

como puedo hacer una formula para que si columna D es igual a la comuna E sea verdadero, pero si columna A + 90 dias es igual al columna E siga siendo verdadero de lo contrario sea falso, gracias.
This comment was minimized by the moderator on the site
Hi, try this formula:=IFERROR(IFS(E2=D2,"TRUE",E2=A2+90,"TRUE"),"""FALSE")
Notice that if you are not in other lagnuage version, maybe you need to transform the formula to your local language.
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations