Avoid HYPERLINK formula when arguments are empty or with error

drom

Well-known Member
Joined
Mar 20, 2005
Messages
543
Office Version
  1. 2021
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Hi! and Thanks in advance

I am trying to use the following Formula:

=IFERROR(IF(OR(B2="";B4="");"Load the invoice's PDF image";HYPERLINK(B2;B4));"Load the invoice's PDF image")

My problem comes when B2 and/or B4 are empty
  • The hyperlink still exists

So you can Click it (the Hyperlink), despite The link goes anywhere

Is there any way to avoid this

ps:
On B2 is the Link_Location, I will put the PDF file's fullname through a Macro (No problem)
On B4 I will put the Friendly_name of the invoice, Kind of Invoice_0001ABC
 
Last edited:

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
You need to check if there is an error in B2 or B4 BEFORE checking their content.

Something close to...
=IF(ISERROR(B2),"Load...",IF(B2="","Load...",IF(ISERROR(B4),"Load...",IF(B4="","Load...",HYPERLINK(B2,B4)))))
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,223,884
Messages
6,175,174
Members
452,615
Latest member
bogeys2birdies

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