Forum Discussion

Ato42's avatar
Ato42
Icon for Microsoft rankMicrosoft
Feb 12, 2020
Solved

Conditional Hyperlink

I'm trying to use a function like "Cell=IF(Condition, HYPERLINK(Link, Text), "HyperLink is not available")".

I expect that the function would work like:

```

if(Condition):

    Cell = HYPERLINK(Link, Text)                     //with hyperlink

else:

    Cell = "HyperLink is not available"            //only contains the text, no hyperlink

```

However, when I apply it in Excel, the cell always contains a hyperlink even if the Condition is false. As the picture shows below.

Could anyone please help me to solve this: let the cell has no hyperlink if the condition is false.

Thank you!

 

  • Ato42 

    To my knowledge HYPERLINK() adds link to entire cell even if it is a part of a formula or text. That's quite old question. I didn't google now, but I don't remember I've seen any workaround.

    • Ato42's avatar
      Ato42
      Icon for Microsoft rankMicrosoft

      Abiola1 

      Hi, Thank you for your reply, but this video cannot solve the problem...

      As the picture shows above, even if the selected text has no text, it has a hyperlink (link to nothing).

      And if I put a text, for example, "A", in the [value_if_false] field, the cell will have a hyperlink link to "A". As the following pic shows:

      However, from my understanding, if the Condition(U66="Yes" in this case) is False, the cell would contain the text "A" only and no hyperlink at all.

      • Ato42 

        To my knowledge HYPERLINK() adds link to entire cell even if it is a part of a formula or text. That's quite old question. I didn't google now, but I don't remember I've seen any workaround.

Resources