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.
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
andC1
), 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
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/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.