Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Conditional Formatting New Rule with Formulas in Excel
  • Example of COUNTIFS with variable table column in Excel
  • How To Remove Duplicates In Excel Column Or Row?
  • Calculate Conditional Percentile ‘IF’ in table in Excel
  • How to conditionally sum numeric data in an Excel table using SUMIFS

References

  • Merge tables with VLOOKUP in Excel
  • How to use Excel MMULT Function
  • Create hyperlink with VLOOKUP in Excel
  • Two-column Lookup in Excel
  • How to use Excel COLUMN Function

Data Validations

  • Excel Data validation specific characters only
  • Excel Data validation must begin with
  • Excel Data validation allow weekday only
  • Excel Data validation with conditional list
  • Prevent invalid data entering in specific cells

Highlight dates in the next N days in Excel

by

This tutorial shows how to Highlight dates in the next N days in Excel  using the example below;

Formula

=AND(A1>TODAY(),A1<=(TODAY()+days))

Explanation

If you want to highlight dates that occur in the next N days with conditional formatting, you can do so with a formula that uses the TODAY function with AND. This is a great way to visually flag things like expiration dates, deadlines, upcoming events, and dates relative to the current date.

For example, if you have dates in the range B4:G11, and want to highlight cells that occur in the next 30 days, select the range and create a new CF rule that uses this formula:

=AND(B4>TODAY(),B4<=(TODAY()+30))

Note: it’s important that CF formulas be entered relative to the “active cell” in the selection, which is assumed to be B4 in this case.

Once you save the rule, you’ll see the dates occurring in the next 30 days highlighted.

How this formula works

The AND function takes multiple arguments and returns TRUE only when all arguments return TRUE. The TODAY function returns the current date. Dates in Excel are simply large serial numbers, so you can create a new relative date by adding or subtracting days. TODAY() + 30 creates a new date 30 days in the future, so when a days is greater than today and less than today + 30, both conditions are true, and the AND function returns true, triggering the rule.

Variable days

Of course, you can adjust days to any value you like:

=AND(B4>TODAY(),B4<=(TODAY()+7)) // next 7 days
=AND(B4>TODAY(),B4<=(TODAY()+45)) // next 45 days

Use other cells for input

You don’t need to hard-code the dates into the rule. To make a more flexible rule, you can use other cells like variables in the formula. For example, you can name cell E2 “days” and rewrite the formula like so:

=AND(B4>TODAY(),B4<=(TODAY()+days))

When you change either date, the conditional formatting rule will respond instantly. By using other cells for input, and naming them as named ranges, you make the conditional formatting interactive and the formula is simpler and easier to read.

Post navigation

Previous Post:

COSH function: Description, Usage, Syntax, Examples and Explanation

Next Post:

Excel Data validation require unique number

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • IF with boolean logic in Excel
  • OR function: Description, Usage, Syntax, Examples and Explanation
  • SWITCH function example in Excel
  • How to return blank in place of #DIV/0! error in Excel
  • AND function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Get work hours between dates custom schedule in Excel
  • Basic Overtime Calculation Formula in Excel
  • EOMONTH function: Description, Usage, Syntax, Examples and Explanation
  • How to get workdays between dates in Excel
  • How to calculate quarter from date in Excel

Grouping

  • Group times into unequal buckets in Excel
  • If cell contains one of many things in Excel
  • Calculate conditional mode with criteria in Excel
  • Group arbitrary text values in Excel
  • Group times into 3 hour buckets in Excel

General

  • How to count total columns in range in Excel
  • Cell References: Relative, Absolute and Mixed Referencing Examples
  • Find, Trace and Correct Errors in Excel Formulas using ‘Formula Auditing’
  • How to get original price from percentage discount in Excel
  • Transpose: Switch ‘Rows to Columns’ or ‘Columns to Rows’ in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning