Excel Formula: Check If Date is Last N Day of Today
Supposing you have a table in Excel, column B is the product name, column C is the corresponding production date, and the shelf life of the products is 7 days. Now to check if the products are due today, you can use a formula to check if the production dates are last 7 days of today.
Syntaxt and arguments
|Date: a cell that refers to a date or a date enclosed with double quotation marks that you want to check if it is last n day of today.|
|N: the number of day that you use to check.|
If the date is last n day of today, it returns TRUE;
If the date is not last n day of today, it returns FALSE.
How this formula works
To check if the dates in range C3:C9 are last 7 days of today, please use below formula:
Or directly use a date enclosed with double quotation marks
Press Enter key to get the first result, then drag autofill handle down to show all dates’ results.
TODAY function: returns to the date of today.
AND function: tests multiple conditions and returns TRUE or FALSE.
Here the formula is divided into two parts:
date>=(TODAY()-7) checks if the date is last 7 days of today;
date<TODAY() checks if the date is later than today.
While both parts return TRUE, the whole formula returns TRUE, or it returns FALSE.
- Check If Date Is Last N Month From Today
Supposing you need to check if staff’s entry date is last 6 months from today, you can use a formula combined by AND, EOMONTH and TODAY functions in Excel to quickly handle the job.
- Get number of worday between two dates
To count the number of workdays between two dates, the NETWORKDAYS function in Excel can help.
- Get quarter from given date
This tutorial provides formulas for you to get quarter from given dates in Excel.
- Get same day last year or next year
In this tutorial, it provides two formulas to separately get the same date last year and next year based on the given date in Excel.
- Excel DATE Function
Create date with year, month and day
- Excel YEAR Function
Returns the year of date in 4-digit serial number format
- Excel MONTH Function
The MONTH is used to get the month as integer number (1 to 12) from date
- Excel DAY Function
DAY function gets the day as a number (1 to 31) from a date
- Excel WORKDAY Function
Add workdays to the given date and returns a workday