How to Perform Automatic Date Change in Excel Using Formula (5 Useful Methods)

We have two simple examples. We need an automatically update the present date and we need to calculate the time remaining to the next Christmas.

excel automatic date change formula


Method 1 – Using a Formula with the TODAY Function to Change the Date Automatically

Steps:

  • Insert today’s date in cell C5 which will be updated automatically in the future as the date gets changed.

Using Formula with Excel TODAY Function to Change Date Automatically

  • Use the following formula in cell C5 and press Enter.
=TODAY()
  • We will see the current date. This article was written on 5th December 2022, so our result is 5-Dec-22.

Using Formula with Excel TODAY Function to Change Date Automatically

  • To verify if this date will be updated in the future, we can manually change the current date on the PC. For this, we are changing the date from 5th December 2022 to 14th December 2022 on my computer. Go to Settings then to Time & Language, choose Set the date and time manually, and click Change.

  • Set the desired date and time and click Change.

  • If we reload the Excel file again, the date is showing 14-Dec-22.

Using Formula with Excel TODAY Function to Change Date Automatically

Read More: How to Insert Date in Excel Formula


Method 2 – Using the NOW Function for Automatic Change of Date

Steps:

  • In cell C5, use the following formula and press Enter.
=NOW()
  • This function is also giving the current date.

Use of NOW Function for Automatic Change of Date

  • As the NOW function returns a dynamic value, it will also get updated automatically like the TODAY function.

Method 3 – Applying a Formula Combination

Steps:

  • In cell C5, use the following formula and press Enter.
=DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())) 
  • You will get the today’s date as a result.

Complex Formula Combinations to Automatically Change Dates

  • As this formula has the dynamic function TODAY, the result will also get automatically updated.

How Does the Formula Work?

The YEAR function fetches the year value from the result of TODAY. The MONTH and DAY functions fetch the month and day values respectively from the result of TODAY. Then the DATE function returns the date.

Note: Instead of the TODAY function, we can also use the NOW function to get a similar result.

Read More: How to Insert Current Date in Excel


Method 4 – Change of Date Based on the Adjacent Cell Value

Case 4.1 – Auto-Update Date upon Data Entry in Adjacent Cell

We have an Input column and a Date of first Data Entry column. The Input column cells are empty. We want the date when we enter the values into those cells for the first time.

Auto Updation of Date upon Data Entry of Adjacent Cell

Steps:

  • In cell C5, use the following formula and press Enter.
=IF(B5<>"",IF(C5<>"",C5,NOW()),"")
  • Use the Fill Handle to autofill the cell C6.
  • If we enter something in cells B5 and B6, Excel will automatically display the current date on cells C5 and C6, respectively.

Auto Updation of Date upon Data Entry of Adjacent Cell

  • Even if you further change the values in B5 or B6, the Dates on C5 or C6 will be unchanged as it is not the first time you are entering the value.

How Does the Formula Work?

  • IF(C5<>””,C5,NOW())

C5<>“” implies Is C5 Not Empty. If it is True (Not empty), it will return C5. Otherwise, it will return present time (NOW).

  • IF(B5<>””,IF(C5<>””,C5,NOW()),””)

If B5 is not empty, then it will return the Present Date and time. Otherwise, it will return a blank cell.


Case 4.2 – Auto-Update Date When the Adjacent Cell Value Gets Changed

Steps:

  • In cell C5, use the following formula and press Enter.
=IF(B5<>"",IF(AND(C5<>"",CELL("address")=ADDRESS(ROW(B5),COLUMN(B5))),NOW(),IF(CELL("address")<>ADDRESS(ROW(B5),COLUMN(B5)),C5,NOW())),"")

Auto-Updation of Date When Adjacent Cell Value Gets Changed

How Does the Formula Work?

IF(B5<>"",IF(AND(C5<>"",CELL("address")=ADDRESS(ROW(B5),COLUMN(B5))),NOW(),IF(CELL("address")<>ADDRESS(ROW(B5),COLUMN(B5)),C5,NOW())),"")

The ADDRESS function returns the address for a cell based on a given row and column number. This formula uses the CELL function to get the reference of the last edited cell, and if it’s the same as the one to the left of it, it updates the date-time value.

  • Use the Fill handle to autofill to C6.
  • When we enter anything in cell B5, the current date will be shown on cell C5.

Auto-Updation of Date When Adjacent Cell Value Gets Changed

  • If we change the input, the Date value will also change.

Auto-Updation of Date When Adjacent Cell Value Gets Changed

If you find an error while applying the formula you should check whether Iterative calculation is enabled. Go to File > Options > Formulas. Check the Enable Iterative Calculation and set the Maximum Iteration to 1.

Read More: How to Insert Dates in Excel Automatically


Method 5 – Calculating a Date Difference Automatically

Let’s say an HR wants to find how long employees have been in the company.

Steps:

  • In cell D5, insert the following formula and click Enter.
=DATEDIF(C5,TODAY(),"m")&" months " &DATEDIF(C5,TODAY(),"md")&" days"

Calculation of Date Difference Automatically

  • If you use the Fill Handle to AutoFill the rest of the cell, you will get the duration for each employee.

Calculation of Date Difference Automatically

  • As this formula has the dynamic function TODAY in it, Excel will update the date automatically.

How Does the Formula Work?

  • DATEDIF(C5,TODAY(),”m”)&” months ” &DATEDIF(C5,TODAY(),”md”)&” days”

We have used a couple of DATEDIFs that find the difference between the Joining Date and TODAY. First DATEDIF calculates the difference in month format (as we have used “m”) and the second one calculates the difference in day format.


Things to Remember

  • If you do not find the result in the proper date format, you can change the formatting of the cell and set the date format you wish to display.

Download the Practice Workbook


Further Readings


<< Go Back to Insert Date | Date-Time in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Shakil Ahmed
Shakil Ahmed

My name’s Shakil. My articles are targeted to support you in enriching knowledge regarding different features related to Microsoft Excel. I am fond of literature, hope some knowledge from them will help me providing you some engaging articles even though some weary technical terms.

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo