In my Google Sheet cell D12
gets the difference of two numbers with =D9 - D4
. How do I store the value in cell D12
to a log in another sheet on a daily basis? I would like each row in the log sheet to show the date and the difference. An onEdit()
based change tracker will not work for this, because the difference should be save once a day rather than every time the sheet is edited, and because the value I want to track is in a formula cell that is never edited.
To permanently record a value in a log once a day, you will need a script. The script should read the value in cell D12 and use sheet.appendRow()
or similar to append it to a log sheet together with a timestamp. Run the script through an installable trigger that executes once a day.
There is a complete example of how to do this in the appendValuesToArchiveSheet script.
onEdit()
function that runs every time the spreadsheet is hand edited. The question specifies that the value should be logged once a day. Further, anonEdit()
function will not run when a value in a formula cell changes because that cell is not hand edited. @Rubén – doubleunary Apr 4 at 5:11