If you want to highlight rows that contain dates between two dates with conditional formatting, you can use a formula based on the AND and DATE functions. In the example, shown, the range B5:E11 has a conditional formatting rule applied using this formula:
Note: it's important that CF formulas be entered relative to the "active cell" in the selection, which is assumed to be B5 in this case.
This formula refers to two named ranges: start (C2) and end (E2).
How this formula works
The AND function takes multiple arguments and returns TRUE only when all arguments return TRUE. Dates are just serial numbers in Excel, so earlier dates are always less than later dates. In the above formula, any dates that are greater than or equal to the start date AND less than or equal to the end date will pass both tests and the AND function will return TRUE, triggering the rule.
References to the start and end dates (C2 and E2) are absolute and will not change. References to the date in column C are "mixed" — the column is locked, but the row number is free to change.
Without named ranges
This formula refers to two named ranges: start (C2) and end (E2). Without using named ranges, the formula would look like this:
This formula exposes the start and end input values directly on the worksheet, so that they can be easily changed. If you want to instead embed (hard-code) the dates directly into the formula, the formula would look like this:
If you want to highlight dates greater than or less than a certain date with conditional formatting, you can use a simple formula that relies on the date function. For example, if you have dates in the cells B4:G11, and want to highlight cells that...
If you want to highlight dates between two dates with conditional formatting, you can use a simple formula that uses the AND and DATE functions together. For example, if you have dates in the range B4:G11, and want to highlight cells that contain a...
The Excel DATE function creates a valid date from individual year, month, and day components. The DATE function is useful for assembling dates that need to change dynamically based on other values in a worksheet.
The Excel AND function is a logical function used to require more than one condition at the same time. AND returns either TRUE or FALSE. To test if a number in A1 is greater than zero and less than 10, use =AND(A1>0,A1...
Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.