I'm trying to print the date when I change the value on a cell (status column). But spreadsheets update the date to today's date. I wish it could save the date from when the status was changed.

The code to print the date:

function TIMESTAMP() {

  var today = new Date();
  var date = Utilities.formatDate(today, 'GMT-3', 'dd/MM/yyyy');
  return date;


In the spreadsheet, the column D is where I set the status and columns H to J print the date from when the status was changed.


The code for column H is the following:

=ARRAYFORMULA(IF(ROW(H:H)=1;"Logística";IF(ISBLANK(D:D);;IF((D:D>=3)*(D:D<6);TIMESTAMP();IF(D:D<1;"Aguardando Pagamento";IF(D:D=2;"Aguardando Etiqueta";IF(D:D=6;"Cancelado";"Aguardando Faturamento")))))))

The codes for columns I and J are similar to H. So, how to print the date from when the status in column D was changed and keep spreadsheet from updating to today's date?


1 Answer 1


One way of solving this is to create Google Apps Script code that runs every time the spreadsheet changes (using the onEdit event - guide here).

The problem with your approach is that in general, all spreadsheet cells get recalculated when their source cells change, thus updating its contents.

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