Google Sheets – Time Triggered Script to Change Cell Contents

google sheetsgoogle-apps-script

What I want to do is for example:

A time will be manually entered into a cell say D3, when it is 20 minutes before this I want cell D1 to change to "20 MIN", WHEN IT IS 5 minutes before I want to change the D1 text to '5 MIN' then when the time reaches now change to "IN PROGRESS", 25 minutes later to change to 'COMPLETE'. This same rule will apply for H – GS (as 4 columns are grouped together).D1 also has a data validation list that needs to stay available for manual override.

Will a script that can do this slow the spreadsheet down as well or not?

I have looked around for scripts but having no luck making it work.

Best Answer

I do not think you need a script.

I think you need a formula that looks at the difference between the value in D3 and the value of =now()-today() .

in you set E1 = now()-today() - d3

then you want something like

D1 = if( E1 < 0.20, "", (if E1 < 0.05, "20 MIN", ..... etc.

(I'm pretty sure that there are easier ways to build a complex if/then/else forumla for a cell, this gives you the general idea.)