How to set up a lastUpdatedAt cell in Google Sheets (#snippet)

I tried many habit trackers over all these years. Nothing stuck for longer than a few months. For now, it looks like I’ll be sticking with a good old Google Sheet.
While setting up a new sheet for 2021, I was looking for a quick way…


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

I tried many habit trackers over all these years. Nothing stuck for longer than a few months. For now, it looks like I'll be sticking with a good old Google Sheet.

While setting up a new sheet for 2021, I was looking for a quick way to display lastModifiedAt/lastUpdatedAt in a sheet row. When I update a value in a row, the idea is that the row also includes the update day information.

Google sheet example showing a table with an updatedAt column

I found a beautiful solution in a StackExchange thread.

Many people in the thread advised to set up a complicated formula or function, but one solution stood out because of its simplicity.

=iferror(A1+B1+C1+"x",today())

You can set the above Excel formula to a cell. This formula tries to sum up all the depending cells (you have to define these) with the value x, and if that throws an error (which it always does), it sets the cell value to today.

Let's go over this formula step by step:

  • whenever you update a dependency (A1, B1 and C1), the cell defining the above formula reacts and is updated as well
  • the calculation adds the value x to the other cell values and throws an error
  • the iferror function catches the error and defines the cell value as today

While this solution might feel hacky, I have to say that I like its simplicity a lot.


Reply to Stefan


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis


Print Share Comment Cite Upload Translate Updates
APA

Stefan Judis | Sciencx (2021-03-07T23:00:00+00:00) How to set up a lastUpdatedAt cell in Google Sheets (#snippet). Retrieved from https://www.scien.cx/2021/03/07/how-to-set-up-a-lastupdatedat-cell-in-google-sheets-snippet/

MLA
" » How to set up a lastUpdatedAt cell in Google Sheets (#snippet)." Stefan Judis | Sciencx - Sunday March 7, 2021, https://www.scien.cx/2021/03/07/how-to-set-up-a-lastupdatedat-cell-in-google-sheets-snippet/
HARVARD
Stefan Judis | Sciencx Sunday March 7, 2021 » How to set up a lastUpdatedAt cell in Google Sheets (#snippet)., viewed ,<https://www.scien.cx/2021/03/07/how-to-set-up-a-lastupdatedat-cell-in-google-sheets-snippet/>
VANCOUVER
Stefan Judis | Sciencx - » How to set up a lastUpdatedAt cell in Google Sheets (#snippet). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/03/07/how-to-set-up-a-lastupdatedat-cell-in-google-sheets-snippet/
CHICAGO
" » How to set up a lastUpdatedAt cell in Google Sheets (#snippet)." Stefan Judis | Sciencx - Accessed . https://www.scien.cx/2021/03/07/how-to-set-up-a-lastupdatedat-cell-in-google-sheets-snippet/
IEEE
" » How to set up a lastUpdatedAt cell in Google Sheets (#snippet)." Stefan Judis | Sciencx [Online]. Available: https://www.scien.cx/2021/03/07/how-to-set-up-a-lastupdatedat-cell-in-google-sheets-snippet/. [Accessed: ]
rf:citation
» How to set up a lastUpdatedAt cell in Google Sheets (#snippet) | Stefan Judis | Sciencx | https://www.scien.cx/2021/03/07/how-to-set-up-a-lastupdatedat-cell-in-google-sheets-snippet/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.