Avoid HYPERLINK formula when arguments are empty or with error

drom

Well-known Member
Joined
Mar 20, 2005
Messages
540
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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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