How to Apply Conditional Formatting to Dates 6 Months prior to Today – 3 Steps

The dataset show cases products and manufacturing dates.

To highlight dates 6 months prior to today in Excel:

excel conditional formatting date less than 6 months from today


Step 1: Select the Range and Add a New Rule

  • Select the dates (C5:C12) and go to Home >> Conditional Formatting >> New Rule.

Add new conditional formatting rule


 Step 2: Choose the Rule Type, Enter a Formula and Select a Fill Color

  • Select Use a formula to determine which cells to format in Rule Type.
  • Enter the following formula in the formula box.
  • Click Format and choose a Fill color.
  • Click OK.
  • Click Apply, and OK again.
=DATEDIF(C5,TODAY(),"m")<6

excel conditional formatting formula and color


 Step 3: Observe the Results

  • This is the output.

result after applying cond. formatting

  • You can also use the following formula:
=EDATE(TODAY(),-6)<C5

Read More: How to Compare Dates in Two Columns in Excel


More Cases of Conditional Formatting for Dates in Excel

Case 1: Applying Conditional Formatting to Dates Older Than 1 Year

  • Use the following formula in the formatting rule.
=DATEDIF(C5,TODAY(),"d")>365

excel conditional formatting for dates oler than 1 year

  • You can also use the following formula:
=DATEDIF(E5,TODAY(),"y")>=1
  • This is the output.

dates older than 1 year


Case 2: Conditional Formatting Based on a Past Due Date

To apply conditional formatting and highlight the due dates within 10 days.

list of dates

  • Use the following formula in the conditional formatting rule for C5:C12.
=B5-C5>10

excel conditional formatting for dates past due

  • This is the output.

dates past due 10 days


Case 3: Conditional Formatting Based on Elapsed Time

The dataset keeps record of the entry and exit times of customers in a shopping mall.

To find the customers who spent more than one hour in the mall:

customer entry and exit times

  • Use the following formula in the formatting rule for B5:D12.
=D5-C5>TIME(1,0,0)

conditional formatting for elapsed time

  • This is the output.

time elapsed more than 1 hour


Things to Remember

  • The TODAY function is a volatile function. It returns the current date and time every time you refresh the worksheet.

Download Practice Workbook

Download the practice workbook.


<< Go Back to Dates | Compare | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Shamim Reza
Md. Shamim Reza

Md. Shamim Reza, a marine engineer with expertise in Excel and a fervent interest in VBA programming, sees programming as a time-saving tool for data manipulation, file handling, and internet interaction. His diverse skill set encompasses Rhino3D, Maxsurf C++, AutoCAD, Deep Neural Networks, and Machine Learning. He holds a B.Sc in Naval Architecture & Marine Engineering from BUET and has transitioned into a content developer role, generating technical content focused on Excel and VBA. Beyond his professional pursuits,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo