Calculating the date one day or one week before the date today seems easy enough. However, when we have to determine the date 30, 60 or 120 days before today, it becomes confusing. Especially when we have to consider that some months have 31 days, others have 30 days, and one month even has 28 or 29 days, depending on whether or not it is a leap year.
Fortunately, Excel allows us to calculate the date N days before today by using the TODAY function and the basic mathematical operation: Subtraction.
Figure 1. Final result: Calculate the date N days before today
How to calculate the date N days before today
The generic formula to calculate the date N days before today is:
First, let us prepare our data.
Figure 2. Sample data to get the date N days before today
Calculate the date 30 days before today
Our formula to calculate the date 30 days ago is pretty straightforward.
Enter the formula in cell D4
Figure 3. Output: Get the date 30 days before today
The TODAY function returns the date today but in the form of a serial number. Then we subtract 30 from the serial number of the date today and come up with a serial number 30 days prior. As a result, our formula returns “06-Apr-19” in cell D4.
Calculate the date 60 days before today
Similar to the previous example, we enter this formula in cell D5
Figure 4. Output: Get the date 60 days before today
Calculate the date 120 days ago from today
Likewise, we can calculate the date 120 days before today by entering this formula in cell D6
Figure 5. Output: Get the date 120 days before today
As a result, the date in D6 is “06-Jan-19”, which is the date 120 days prior to today.
Instant Connection to an Excel Expert
Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.