I have a Google sheet containing a list of events, with event dates listed in one column. I'd like to have my Google Sheets spreadsheet jump to the closest date to today's date on opening (i.e., either today or the next upcoming date).
Can someone help me with the script to do this?
I have tried using Script Editor to jump to the current date in my Google sheets spreadsheet (using "function onOpen" solution posted previously). However, since my date column does not include every day of the year (e.g., 09/25/18, 09/29/18, 09/30/18, 10/03/18 etc), the spreadsheet doesn't focus to the current period unless today's date happens to be one of those listed in my date column.
Best Answer
I was able to piece together a solution thanks to the help of @Rubén who provided the elements. Perhaps there is a more elegant solution (with a single formula?), but this working for me.
This involves using formulas in 2 different cells, as well as a script.
Formula #1 ##
Placed in cell A1 in this case
Formula #2
Placed in Cell B1, references Formula #1.
Script - in script editor:
Focuses the sheet to the row indicated in formula 2 when the sheet is opened