Hyperlink to a column that matches todays date
I have a staff rota (the dates are all in cells in seperate columns). I'm trying to create a HYPERLINK to jump to the column with today's date. I have tried the following but this appears it is for rows as opposed to columns. I'm a excel novice so looking for advice.
=HYPERLINK("#2"&MATCH(TODAY(),E2:FC2,0)+1,"Jump to Today")
In the formula ribbon, there is a tool called "Evaluate Formula" that can be very useful for tracing these kinds of issues.
It lets you step through the formula one piece at a time so you can see where the error occurs.
In this case, we get all the way to the final formula and it seems to work but the reference isn't valid. That final formula is:
=HYPERLINK("#26","Jump to Today")
The reference here is "#26"
. The problem is that's not a valid reference. The help page for HYPERLINK() gives examples of using the function to reference other cells in the same worksheet. It's clunky. You have to include both the file name and the sheet name. That's half the problem. The other half is that [Book1.xlsx]Sheet1!#26
still isn't a valid reference. I think what you want is to select the value in the range E2:FC2
that has today's today. I would do that using R1C1 notation just because it's easier in this case. The formula would be:
=HYPERLINK("[Book1.xlsx]Sheet1!R2C"&4+MATCH(TODAY(),E2:FC2,0),"Jump to Today")
-
Book1.xlsx
is the name of the file. -
Sheet1
is the name of the worksheet. -
R2C
starts the R1C1 reference by giving us row 2 and some column. -
4+MATCH(~)
gives us the right column number based on where today's date is found.