Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I automatically set "last updated" cell in row Google Docs Spreadsheets ?

I want to create a column where the cells' value will be automatically set to when that row was last amended. Is this possible? How do I do this / what option do I use to set this?

I see a workaround for MS Excel but I think Google Docs should have something similar, right? (fingers crossed)

We have multiple people editing a large sheet. We can see revision history, but it would be nicer if we had a column of "last updated" dates as well.

share|improve this question
Have you tried? If it work, then please mark as such, see webapps.stackexchange.com/faq#howtoask. – Jacob Jan Tuinstra Jan 27 '13 at 18:37
up vote 10 down vote accepted

You can try adding a Google Apps Script to capture when a cell is edited and add a timestamp to a different cell. Here's a previous answer that is similar: Google Spreadsheet Timestamp?

function onEdit() {
 var s = SpreadsheetApp.getActiveSheet();
 if( s.getName() == "Sheet1" ) { //checks that we're on the correct sheet
   var r = s.getActiveCell();
   if( r.getColumn() == 13 ) { //checks the column
     var nextCell = r.offset(0, 1);
     if( nextCell.getValue() === '' ) //is empty?
       var time = new Date();
       time = Utilities.formatDate(time, "GMT", "HH:mm:ss");
share|improve this answer
looks good i will give it a try – cwd Oct 17 '12 at 19:18
A user without enough rep for a comment has asked How do I make it work this scripts for anonymous users? – pnuts Jun 4 '14 at 11:28
Please try my answer to Google Sheets HTML Service Sidebar to run code as owner – daniel Feb 26 at 1:29

This is my script, put in the last column this information:

  1. Insert into the Cell (in the last cell = lastcolumn for the row that you modify) - Date in GMT -3, if you want to put the same in other TZ just modify the -3 for you concurrent timezone. If you want to put the date automatically in your default TZ, just modify this:

    var date = Utilities.formatDate(new Date(), "GMT-3", "dd/MM/yyyy HH:mm");
    var date = Utilities.formatDate(new Date());
  2. Insert a Comment with the Cell+User who modify it.

  3. Appear a popup when you update something. Only appear to the ActiveUser.

    function onEdit(event)
        var ss = SpreadsheetApp.getActiveSpreadsheet();
        var actSht = event.source.getActiveSheet();
        var actRng = event.source.getActiveRange();
        var index = actRng.getRowIndex();
        var dateCol = actSht.getLastColumn();
        var lastCell = actSht.getRange(index,dateCol);
        var date = Utilities.formatDate(new Date(), "GMT-3", "dd/MM/yyyy HH:mm");
        lastCell.setComment("Ultima Modificacion: " + actRng.getA1Notation() +' por '+Session.getActiveUser());
        ss.toast('Ultima Modificacion = '+ actRng.getA1Notation()+' por '+Session.getActiveUser());
share|improve this answer

Simply type "Last updated:" in one cell and type "=now()" in the cell next to it! That should do the job!

share|improve this answer
=now() will update for changes other than when that row was last amended. – pnuts Jun 4 '14 at 11:47
This will only work per-cell, not per row as stated in the question – 1owk3y Apr 26 at 0:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.