One of the most common tasks in Excel is working with dates. In many cases, you may want to automatically enter date when data entered in excel into a particular cell.
Automatically entering the date will reduce the possibility of errors and save you time as well.
In this article, we will explore different methods for Excel to automatically enter date when data is entered in a particular cell, including using features, formulas, and macros.
By the end of this article, you will have a better understanding of how to automate the date entry process in Excel and improve your productivity.
Automatically Enter Date When Data Entered in Excel: 2 Easy Ways
In this section, we will discuss how Excel automatically enters the dates when data is entered in a particular cell, following 2 simple and effective ways.
We will enter some data (i.e. name) consecutively in an Excel sheet and with every entry of data, you will find the corresponding current date entered into the specific cell of the worksheet.
1. Using IF and NOW Functions to Enter Date Automatically (Timestamps)
Now, let’s assume that we want the entry time of each employee in an office & the employees will input their entrance timestamps by entering their names only in a spreadsheet column every day. Another column next to it will show automatically their entry timestamps along with the dates when they enter their names in the first column.
How shall we do this? We will combine the IF function with the NOW function for executing this task.
- Select cell C5 and enter the formula below:
This is the base formula for the Timestamp function. What’s happening here is that if Cell B5 remains empty, Cell C5 will be empty too. And when input data will be entered in Cell B5, then Cell C5 will show the timestamp at once. The whole thing will be executed by the combination of two simple functions- IF & NOW. We’ll use IF to enter the condition & NOW function will show the time when data is entered.
- Drag the Fill Handle down to the last cell in Column C (the column specified for entry of data).
- Go to the File tab.
- Choose Options from the menu.
- From the Excel Options window, select the Formulas tab & mark the Enable Iterative Calculation >> Click OK.
What we’re doing here is telling Excel that any cell in Column C may need to refer to itself in the function during data entry in Column B to execute the function. And if we don’t enable this iterative calculation from Excel options then an error message prompt will be shown during data entry.
- Now, insert a name in Cell B5 & press ENTER.
- You’ll see the date & timestamp right away in Cell C5.
- In Cell B6, put another name and the prospective result will be shown right to it in Cell C6.
Thus you can enter any name or data in Column B and you’ll get to know the date & timestamps next to them.
2. Customize Excel Function by Embedding VBA and Enter Date Automatically
In Excel, you can use VBA code to perform enormous operations for its multidimensional characteristics. You can use the VBA code to enter the date automatically with every entry of data.
First, you have to create your own customized function by formatting it with VBA code. We’re going to know the Entry Time of the employees once again here but this time with our own function.
- Press ALT+F11 & VBA window will appear on the screen. Or you can do it manually: go to the Developer tab >> select Visual Basic.
- Click Insert >> select Module.
- Insert the VBA code in the appeared Module window.
Function EntryTime(LeftCell As Range)
If LeftCell.Value <> "" Then
EntryTime = Format(Now, "dd-mm-yy hh:mm:ss")
EntryTime = ""
- Select Cell C5 & type the following formula as EntryTime is the new function we’ve just built with VBScript.
- Use the Fill Handle once again to copy the formula up to Cell C10 or more according to your need.
- Now, you will see the Entry Time in cell C5 as soon as you enter data in cell B5.
Read More: How to Insert Date in Excel Formula
More Ways to Insert Date and Time Automatically in Excel
In the previous section, we have figured out the process to get the time with every individual entry of data. Let’s check out some more ways of how Excel automatically enters a date when data is entered in a cell of the worksheet.
1. Using Autofill Feature with Multiple Criteria (Days, Weekdays, Months or Years)
If you need to input dates according to chronological order, then the Autofill option will suit you best. In the picture below, you have to use the Fill Handle in Cell C5 to drag it to C15. From the drop-down in the corner, you’ll find multiple criteria like
- Fill Days
- Fill Weekdays
- Fill Months
- Fill Years
Select the option you need and get the corresponding result.
2. Applying Fill Series Command to Customize Autofill Option
You can use the Fill Series option too if you need to customize dates more including intervals.
- Select the range of cells >> go to the Home tab >> select Fill under Editing group >> click Series.
Here, the Series box will appear to let you customize dates according to your criteria.
- Select Series in as Columns, Type as Date & Date unit as Day.
- Type ‘2’ as the Step Value (common difference in an arithmetic progression or series)
- Click OK.
As we have used Step Value as 2 for getting Date as Day, Excel will show output as the progression of days with an interval of 2 like below.
Changing the Date Unit section of the Series box to Weekdays, Months, and Series will get your output just like the previous Method.
Read More: How to Insert Current Date in Excel
3. Use the Keyboard Shortcut to Enter the Instant Time and Date
To get today’s date & current timestamp we can use keyboard shortcuts directly.
In any cell where you want to know:
- For today’s date, press Control + Semi-colon (CTRL + ;).
- Use (CTRL + SHIFT + ;) to enter the current time automatically.
- If you want to enter both in a cell, then press (CTRL + ;) 1st, then SPACE & finally (CTRL + SHIFT + ;).
4. Applying the TODAY Function to Enter Today’s Date
Excel has a default TODAY function to input today’s date.
Consider the image below where we have used a dataset of order date and the delivery date of some customers where possible delivery is assumed as today’s date.
Just select a cell where you want to get the date of today and enter the following formula.
You will get the date of the day you entered.
5. Use the NOW Function to Enter the Current Time and Date
The NOW function adds a timestamp along with the date.
For the dataset in the image below, we have applied the NOW function in the merged cell D5.
That formula returns both the current date and time.
Read More: How to Insert Dates in Excel Automatically
Frequently Asked Questions
1. How do I stop Excel from automatically entering the date when data is entered?
Use a space or apostrophe before you enter your date or number. The space and the apostrophe are not visible in the cell after pressing ENTER.
2. Can Excel automatically update Data?
To keep the external imported data updated, refresh the data in the worksheet.
Takeaways from This Article
- Automatically updating of the date can be helpful for keeping track of when data was last updated or entered.
- The smartest approach seems to use the TODAY function combined with the IF function.
- You can also customize the date format and location within the cell.
- Automatic updates of the dates can save time and reduce errors by ensuring that the date is always entered accurately and consistently.
- You should also be aware of potential issues that may arise, such as the date not updating properly if the file is saved and reopened on a different day.
Download Practice Workbook
Download the workbook here that we’ve used to prepare this article.
So, in conclusion, we can say that Excel can automatically enter a date when data is entered in a cell. This feature can be a useful tool for ensuring that important data is always accompanied by the date it was entered or last updated. However, it’s important to use this feature appropriately and be aware of any potential issues that may arise. When used correctly, this feature can save time and reduce errors, making it a valuable tool for anyone working with Excel.
- How to Auto Populate Date in Excel When Cell Is Updated
- How to Perform Automatic Date Change in Excel Using Formula
- How to Insert Day and Date in Excel
- How to Get the Current Date in VBA