If statement with conditional Hyperlink for one output and text for the other

ShogunStealth

New Member
Joined
Nov 6, 2021
Messages
24
Office Version
  1. 2019
Platform
  1. Windows
I need to create and IF statement that when it is true it outputs a hyperlink text and when false it just plain text and so when you hover over the cell [false] it doesn't change to hand?

Sound simple enough but I can't work it out.

Something like =IF(A2=B2,HYPERLINK(B2,"Link"), "No Link")

This treats the "No Link" cells like a hyperlink
 
Excel treats hyperlinks with links to cell references differently. You need to include the workbook and sheet name as well as the cell reference like this:

  1. Excel Formula:
    = IF(A2=B2, HYPERLINK("[Book1.xlsx]Sheet1!A1", "Link"),"No Link")
    or
  2. Excel Formula:
    = IF(A2=B2, HYPERLINK("[Book1.xlsx]Sheet1!A1", "Link"), HYPERLINK("", "No Link"))
When using (1) the once created hyperlink may stay even if the condition is not met.
As a workaround you could use (2).
 
Last edited:
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top