Google sheet : How to add timestamp when any cell in column changes value

As DevOps Engineer, there are cases where logging and monitoring is crucial as well as an important part, either you have shared inventory sheet or sales and purchase sheet with team members, you need to make sure when any crucial column’s value changes, we note timestamp, to be up-to-date. This tutorial will help you to automatically add/edit timestamp when any cell’s value changes Share your google sheet

Add/Edit timestamp whenever any user changes the value to a particular cell, follow this tutorial to know Step by step tutorial to add automatic timestamp integration in google sheet

1

Create a new google sheet / edit existing google sheet

2

Add required columns

3

Add timestamp column

You can add timestamp column after main column for which you are logging timestamp

4

Change timestamp format

– Select timestamp column – Click on Format – Click on Number – Select Date and Time format that suits your requirement

5

Go to Script Editor

– Click on Tools – Select – Script Editor

It will pop up google apps script window in new tab

Name your Apps Script

Copy below code

function onEdit(e) {   var row = e.range.getRow();   var col = e.range.getColumn();    if(col == 1){     e.source.getActiveSheet().getRange(row,2).setValue(new Date());   } }

6

Add Trigger

– In left pane, Select Triggers (Allow pop-up) – Click on “Add Trigger”

Choose mentioned details

1. Choose which function to run: onEdit 2. Choose which deployment should run: Head 3. Select event source: From SpreadSheet 4. Select event type: On edit 5. Failure notification settings: Notify me immediately

7

Finish

Add entry in specific column and see timestamp getting added automatically

You can add timestamp for whichever and as many column as you want

Thank You