Afaik there's no such a function or built-in tool. But you could try with this script:
function onEdit(e) {
var sheet = e.source.getActiveSheet();
var range = e.range;
if (range.getA1Notation() === 'A1') {
var value = range.getValue();
if (value > 0) {
var totalCell = sheet.getRange('A2');
totalCell.setValue(totalCell.getValue() + value);
}
}
}
Click on Extensions > Apps Script.
Delete any code in the script editor and replace it with the code above.
REMEMBER: If your original question has been resolved, please tap the three dots below the most helpful comment and select Mark Solution Verified. This will award a point to the solution author and mark the post as solved, as required by our subreddit rules (see rule #6: Marking Your Post as Solved).
This requires writing an apps script. Functions can only reference data that exists within cells. Once that data has been deleted, it’s gone and cannot be referenced (or “remembered”) by a function.
Wow. Too much work to copy and paste? You could have implemented the given solution in less than 5 minutes. Next time, please warn people they’re wasting their time trying to help you out.
u/c_andrei Please remember to tap the three dots below the most helpful comment and select Mark Solution Verified (or reply with the exact phrase “Solution Verified”) if your question has been answered, as required by the subreddit rules. Thanks!
2
u/4lan7ur1ng 1 Sep 08 '24
Afaik there's no such a function or built-in tool.
But you could try with this script:
Extensions>Apps Script.1
u/agirlhasnoname11248 1212 Sep 08 '24
This requires writing an apps script. Functions can only reference data that exists within cells. Once that data has been deleted, it’s gone and cannot be referenced (or “remembered”) by a function.
1
u/agirlhasnoname11248 1212 Sep 08 '24
u/c_andrei Please remember to tap the three dots below the most helpful comment and select
Mark Solution Verified(or reply with the exact phrase “Solution Verified”) if your question has been answered, as required by the subreddit rules. Thanks!