How to Insert a Static Timestamp in Google Sheets

From my perspective, we can insert three types of timestamps (or datetimes) into Google Sheets based on their behavior: dynamic, static, and conditional static.

Dynamic:

The auto-updating (dynamic) timestamp refreshes every time you edit your Sheet or when you reopen it. We use the built-in NOW() function for this.

Static:

The static datetime does not refresh or update when you modify your Sheet. We use a simple shortcut to insert it manually.

Conditional Static:

The third type is inserting a static conditional timestamp in Google Sheets.

In this method, we use an Apps Script to automatically insert a static datetime in one cell when we enter a value in another cell.

It updates only if that specific “trigger” cell changes — no other edits in the Sheet affect it.

Dynamic Datetime and the NOW Function

You can use the NOW() worksheet function in Google Sheets to insert a timestamp that updates on every edit.

Just type =NOW() in cell A1 to insert the current date and time.

It will recalculate and refresh every time you make a change anywhere in your Sheet.

What else can you use it for?

We can also use NOW() in logical tests. For example, if B4 and C4 store a task’s start and end times, you can calculate elapsed and remaining durations like this:

  • =NOW()-B4 — Elapsed time
  • =C4-NOW() — Remaining time
Dynamic Datetime Example and Usage in Google Sheets

Real-Life Use: Dynamic Datetime Formula

You can find a practical example of using the NOW() function in my countdown timer tutorial.

Insert a Static Timestamp Using a Shortcut in Google Sheets

The best way to insert a static timestamp manually is by using keyboard shortcuts.

It depends on your OS:

  • On Windows, press Ctrl + Alt + Shift + ;
  • On Mac, press Command + Option + Shift + ;

(Note: In my testing on Mac, the shortcut didn’t work. Google’s documentation says, “Some shortcuts might not work for all languages or keyboards.”)

How to insert a static date and time in a cell:

  • Select cell A1.
  • Apply the appropriate shortcut.
  • Check the formula bar — you’ll see the value is static (no formula inside).
Insert a Static Timestamp in Google Sheets Using Keyboard Shortcuts

Insert a Static Conditional Timestamp Using Apps Script

Earlier, Google Sheets allowed the creative use of LAMBDA functions to create conditional timestamps.

For example, you could use a formula like this in cell A1:

=LAMBDA(timestamp, IF(B1<>"", timestamp, IFERROR(1/0)))(now())

You could then copy it down the column to apply to multiple rows.

Insert a Static and Conditional Timestamp in Google Sheets

However, LAMBDA-based static timestamps aren’t reliable anymore.

So now, the best method is to Insert a static timestamp in Google Sheets using Apps Script.

Here’s a simple script for that:

function onEdit(e) {
  var sheet = e.source.getActiveSheet();
  var editedCell = e.range;

  // Define the specific range you want to monitor
  var watchColumn = 1; // Column A
  var timestampColumn = 2; // Column B
  var startRow = 2;
  var endRow = 10;

  // Only act if the edited cell is within A2:A10
  if (editedCell.getColumn() == watchColumn && editedCell.getRow() >= startRow && editedCell.getRow() <= endRow) {
    var cellValue = editedCell.getValue();
    var timeCell = sheet.getRange(editedCell.getRow(), timestampColumn);
    
    if (cellValue !== "") {
      timeCell.setValue(new Date());
    } else {
      timeCell.clearContent(); // Clear timestamp if the edited cell is cleared
    }
  }
}

This script is set to monitor the range A2:A10 and insert timestamps into B2:B10 when you enter values.

Modify for Other Ranges

You can easily adjust the script:

  • To monitor A:A and insert timestamps in B:B, remove the startRow and endRow limits.
  • To monitor C10:C50 and insert timestamps into D10:D50, change:
    • watchColumn = 3 (for column C)
    • timestampColumn = 4 (for column D)
    • startRow = 10
    • endRow = 50

How to Set It Up

  1. Open your Google Sheets file.
  2. Navigate to Extensions > Apps Script.
  3. Delete any placeholder code and paste the above script.
  4. Save the project (click the floppy disk icon).
  5. Done! It works automatically — no need to manually run it.

This is how you can Insert a static timestamp in Google Sheets conditionally — automatically inserting a timestamp when a value is entered in a specific cell.

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

How to Sort Pie Slices in Google Sheets

To sort pie slices in a pie chart, you need to sort the data...

Filter Items Unique to Groups in Google Sheets

In this tutorial, we'll learn how to filter items unique to groups in Google...

Find Common Items Across Multiple Columns in Google Sheets

This tutorial explains how to find common items across multiple columns in Google Sheets....

Sort Column by Length of Text in Google Sheets

To sort a column by length of text, you can either use the QUERY...

More like this

How to Sort Pie Slices in Google Sheets

To sort pie slices in a pie chart, you need to sort the data...

Filter Items Unique to Groups in Google Sheets

In this tutorial, we'll learn how to filter items unique to groups in Google...

Find Common Items Across Multiple Columns in Google Sheets

This tutorial explains how to find common items across multiple columns in Google Sheets....

5 COMMENTS

  1. Thank you for the static conditional timestamp formula. It was exactly what I needed, especially since the sheet will be primarily accessed via mobile devices.

    I just wanted to share a small edit for those who only want the time and not the date:

    =LAMBDA(timestamp, IF(LEN(B1), timestamp, IFERROR(1/0)))(TEXT(NOW(),"hh:mm:ss"))

    • Good suggestion. Since the output is text, if you prefer not to use formatted text, try the formula below:

      =LAMBDA(timestamp, IF(LEN(B1), timestamp, ))(MOD(NOW(),1))

      Then select the formula cell and apply Format > Number > Time.

  2. So, I’m using a different formula to achieve the same result.

    I would love to learn whether we can convert it to an ARRAY formula.

    The formula I’m using works for me. But I’m collaborating with others on the same sheet who have editing rights. For some editors, though, it provides N/A# instead of a timestamp.

    Weird, right? Just curious if you knew why it would be showing N/A# on some editor’s Sheets but not others.

    **If checkbox is checked in B2…**
    =if(A2,lambda(x,x)(now()),)

    **If cell has the word “Complete”…**
    =if(A2="Complete",lambda(x,x)(now()),)

    Thanks for your help!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.