Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to insert yesterday's date in googlesheet

I'd like to enter yesterday's date in certain cells in googlesheet, and not have it autoupdate. e.g., TODAY() and NOW() autoupdate. I know I can use Ctrl+; to get today's date, and that remains static. I need the equivalent for yesterday's date.

Googling hasn't turned up anything yet, and neither has the googlesheet docs.

Thanks for any help. David

like image 856
David O'Brien Avatar asked Dec 22 '22 19:12

David O'Brien


1 Answers

Use

  • TODAY()-1 or NOW()-1

Then copy > paste as values only

The above works because Google Sheets dates are serial numbers where the unit is 1 day.

You could create a macro that does the above which could be called by using a keyboard shortcut. For details about how to create a macro please read https://developers.google.com/apps-script/guides/sheets/macros

like image 149
Rubén Avatar answered Dec 27 '22 10:12

Rubén