I am looking for a way to create a function using script editing within google sheets that would allow me to insert a static timestamp into a cell based on multiple criteria. All I need is a custom function to simply retrieve the current date. I have absolutely no background in script editing and have been struggling to no avail. Can someone provide for me a simple script that would be able to be copied and pasted?
Thank you!!
Here is a script that will set a timestamp on the neighboring cell
function onEdit(event){
var f = event.source.getActiveSheet();
var r = event.source.getActiveRange();
if ((r.getColumn() == 2) && (f.getName() == 'mySheet') && (r.getRow() > 2)){
r.offset(0,-1).setValue(new Date());
}
}