I have just tied to use the hyperlink function in an if formula in a cell. Essentially the formula if condition is if there is no value in another cell then hyperlink to that cell (I use the # prefix ) and if there is a value then use that value. In simple terms if is:
=If($A$1=“”, hyperlink(“#$A$1”, “Click here”), $A$1)
I will admit that the cell reference is a calculation to find an adjacent cell value and reference the target cell using an Address, Index, Match combination, but the formula above is a simplified version
The problem is that if there is no value in the target cell, the hyperlink works just fine. However, if there is a value, then the value is displayed in the formula cell but clicking in that cell produces a hyperlink error “Can’t open the file”. Empirically this suggests that there is somehow a residual but corrupted hyperlink associated with the cell. Does anyone know why this will be happening?
The only way I can see around this problem is to have two hyperlink functions for each of the IF true and false conditions to explicitly define the hyperlink for both outcomes like:
=if($A$1=“”, hyperlink(“#$A$1”, “Click here”), hyperlink(“#$A$1”, $A$1))
Frankly this is probably most appropriate as I don’t want the user to be able to enter a value in that cell but take them to the target cell where the value should be entered. So I’ve worked around my problem but the question is still there and I’d appreciate if anyone can explain this behaviour.
Thanks again.
Max
=If($A$1=“”, hyperlink(“#$A$1”, “Click here”), $A$1)
I will admit that the cell reference is a calculation to find an adjacent cell value and reference the target cell using an Address, Index, Match combination, but the formula above is a simplified version
The problem is that if there is no value in the target cell, the hyperlink works just fine. However, if there is a value, then the value is displayed in the formula cell but clicking in that cell produces a hyperlink error “Can’t open the file”. Empirically this suggests that there is somehow a residual but corrupted hyperlink associated with the cell. Does anyone know why this will be happening?
The only way I can see around this problem is to have two hyperlink functions for each of the IF true and false conditions to explicitly define the hyperlink for both outcomes like:
=if($A$1=“”, hyperlink(“#$A$1”, “Click here”), hyperlink(“#$A$1”, $A$1))
Frankly this is probably most appropriate as I don’t want the user to be able to enter a value in that cell but take them to the target cell where the value should be entered. So I’ve worked around my problem but the question is still there and I’d appreciate if anyone can explain this behaviour.
Thanks again.
Max