Skip to main content

How to conditional formatting based on date in Excel?

Author: Sun Last Modified: 2020-09-14

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.


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


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!
Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How can I automatically add a date when a cell contains certain text? So, for example, if cell A1 contains "to do", a date is automatically added in another cell. This date is based on a date also from a cell and I would like to add a date + 65 days in the future. Is this possible?
This comment was minimized by the moderator on the site
Cześć, mierzę się z problemem warunkowego podświetlania daty, np.: w kolumnie A mam datę startu danej czynności np. 01.01.2023, w kolumnie B mam datę końca danej czynności np. 07.01.2023 i chodziłoby mi o to, żeby wyróżnić warunkowo np. kolorem zielonym datę w kolumnie B jeżeli pomiędzy datą startu, a datą końca czynności upłynęło mniej niż 7 dni, jeżeli 7 dni i więcej kolorem czerwonym.
This comment was minimized by the moderator on the site
Use two formulas in the conditional formatting dialog:
difference between start date and end date is greater than or equal to 7 days: =B2-A2>=7 format to red
difference between start date and end date is smaller than 7 days: =B2-A2<7 format to green
see screenshot:
https://cdn.extendoffice.com/images/stories/comments/sun-comment/doc-difference-greater-than-7.png
This comment was minimized by the moderator on the site
Cześć, mierzę się z problemem warunkowego podświetlania daty, np.: w kolumnie A mam datę startu danej czynności np. 01.01.2023, w kolumnie B mam datę końca danej czynności np. 07.01.2023 i chodziłoby mi o to, żeby wyróżnić warunkowo np. kolorem zielonym datę w kolumnie B jeżeli pomiędzy datą startu, a datą końca czynności upłynęło mniej niż 7 dni, jeżeli 7 dni i więcej kolorem czerwonym.
This comment was minimized by the moderator on the site
Cześć, mierzę się z problemem warunkowego podświetlania daty, np.: w kolumnie A mam datę startu danej czynności np. 01.01.2023, w kolumnie B mam datę końca danej czynności np. 07.01.2023 i chodziłoby mi o to, żeby wyróżnić warunkowo np. kolorem zielonym datę w kolumnie B jeżeli pomiędzy datą startu, a datą końca czynności upłynęło mniej niż 7 dni, jeżeli 7 dni i więcej kolorem czerwonym.
This comment was minimized by the moderator on the site
Ciao, come posso utilizzare il conditional formatting per evidenziare il mese corrente e il mese successivo?
This comment was minimized by the moderator on the site
Hi, Michela,
highlight the date in current month, please use formula =TEXT(TODAY(),"m")-TEXT(A1,"m")=0 in conditional formatting new rule dialog, and select a color such as yellow to outstanding the dates.
highlight the date in next month, use formula =TEXT(A1,"m")-TEXT(TODAY(),"m")=1 in conditional formatting new rule dialog, and select a color such as green to outstanding the dates.
see screenshot:
https://cdn.extendoffice.com/images/stories/comments/sun-comment/doc-highlight-current-month.png
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations