Excel: Quickly scroll to the current date.

Sometimes you need to be able to quickly scroll to the current date in your schedule or another tracker. The below Excel functionality allows us to do that quite simply and elegantly.


The solution is this formula:
=HYPERLINK("#"&ADDRESS(2,MATCH(TODAY(),2:2,0)),"Go to current date")


Explanation of how this works:


  • The MATCH function looks through all the values in the row 2 ("2:2"), finds the cell that matches the today's date and returns the numeric (not literal) value of that cell's column number for that row's cell.
  • So now, we need to somehow convert that column number to a literal reference and that is done via the ADDRESS function. That function is using the row number (first argument) and the column number (second argument) to get a cell reference in the format [<literal column reference><numeric row reference>>.
  • The cell reference is then used as a hyperlink destination along with the proper descriptor ("Go to current date"):
 =HYPERLINK("#"&ADDRESS(2,MATCH(TODAY(),2:2,0)),"Go to current date")

Please note that the above approach can be used to quickly scroll to any value of interest - just change TODAY() to whatever the matching criterion you are interested in.

Comments

Popular posts from this blog

Whitelist an Azure firewall IP using PowerShell

Excel: highlighting a row or a column based a value, the current date example.