Search code examples
excelexcel-formulaconditional-formatting

Excel Conditional Formatting - If Date Z Within XX Days of Date Y


i’m trying to set up conditional formatting where a cell is highlighted if a date in Cell A1 is within 40 days of date in Cell A2. Any help appreciated!

Tried IF(A1=A2+40). Seen lots of example using TODAY function but i need it to be against a date in another cell, not today.

enter image description here


Solution

  • Try custom CF-

    =AND(($B1-$A1)>0,($B1-$A1)<40)
    

    enter image description here