3 Tips for Adding the Current Date and Time in Google Sheets

Do you find yourself frequently needing to add the current date and time in Google Sheets? Whether it’s to mark the opening of a workbook or to record the time of a specific entry in a cell, there are several methods to automatically insert the current date and time. In this article, we will explore each of these methods in detail.

Use Functions to Insert the Current Date and Time

If you prefer to avoid manually updating the date and time in your workbook, the best solution is to use the built-in functions of Google Sheets. The “TODAY” and “NOW” functions allow you to respectively insert the current date and time in your spreadsheets.

Insert the Current Date with the “TODAY” Function

The “TODAY” function allows you to insert the current date in a cell. By default, the date is displayed in the “MM/DD/YYYY” format. You can use the formula “=TODAY()” to get the current date in your spreadsheet.

=TODAY()

Keep in mind that the “TODAY” function is volatile, which means it automatically recalculates the date whenever you make changes to the workbook. So, use it with caution.

Insert the Current Time with the “NOW” Function

If you want to display the current date and time, the “NOW” function is the best option. By default, the date and time are displayed in the “MM/DD/YYYY HH:MM:SS” format. You can use the formula “=NOW()” to get the current date and time in your spreadsheet.

=NOW()

If you only want to display the current time, you can use a custom format to convert the date and time value into a time-only value. You can use the formatting options in Google Sheets to display the time in the format of your choice.

Use Keyboard Shortcuts to Insert the Current Date and Time

Google Sheets is packed with keyboard shortcuts that help you save time on manual tasks. If you want to add a static date or time that doesn’t change with each recalculation of the sheet, you can use keyboard shortcuts.

Keyboard Shortcut to Insert the Current Date

To insert the current date in Google Sheets, you can use the keyboard shortcut Ctrl + ; (semicolon).

Keyboard Shortcut to Insert the Current Time

To insert the current time in Google Sheets, you can use the keyboard shortcut Ctrl + Shift + : (colon).

Keyboard Shortcut to Insert the Current Date and Time

If you want to insert the current date and time in Google Sheets, you can use the keyboard shortcut Ctrl + Shift + Alt + ; (semicolon).

Use Apps Scripts to Insert the Current Date and Time

Almost everything can be automated in Google Sheets using Apps Script. This powerful, JavaScript-based programming language, adopted by Google for automation, allows you to automatically fill in the current date and time whenever a specific event occurs.

To add the current date and time in your spreadsheet based on a particular event, you can use Apps Scripts. For example, you can write an “onEdit” function that automatically adds the current date when someone on your team marks a task as completed.

Here’s how you can write this “onEdit” function in Apps Script:

function onEdit(e) {
  var row = e.range.getRow();
  var col = e.range.getColumn();
  if (col == 4 && row > 1 && e.range.getValue() == "Completed") {
    e.source.getActiveSheet().getRange(row, 3).setValue(new Date());
  }
}

Save this code using the “Save” button in the Google Apps Script toolbar. Once you enter the text “Completed” in column “D” of the spreadsheet, you’ll see that the system automatically adds the current date.

Note that the “onEdit” function is automatically triggered when the spreadsheet is edited, so you don’t need to run it manually.

Conclusion

In this article, we have explored different ways to add the current date and time in Google Sheets. Whether you use the built-in functions, keyboard shortcuts, or Apps Scripts, there are plenty of options to automate this frequent task.

I hope you found this article helpful. If you know any other ways to add the current date and time in Google Sheets, feel free to share them in the comments section below.

To learn more about Google Sheets and other online marketing tips, visit the website Crawlan.com.

Related posts