Hyperlink variable on cell having text?

Kiloelectronvolt

Board Regular
Joined
Oct 5, 2015
Messages
61
Office Version
  1. 365
Platform
  1. Windows
Hi Guys, I'm a novice so I'm trying to avoid using VBA. I currently have this hyperlink working well, but I was wondering if I could add one more line to it.

=HYPERLINK("path...\Job PO's 2021\PO "&A3263&"-signed.pdf",WORKDAY(J3263,5,))

IF L3263 is blank, use below path,

path...\Job PO's 2021\PO "&A3263&"-signed.pdf

BUT if L3263 has text, use:

path...\Job PO's 2021\PO "&A3263&".pdf

TIA
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Kiloelectronvolt

Board Regular
Joined
Oct 5, 2015
Messages
61
Office Version
  1. 365
Platform
  1. Windows
I figured it out, may not be the best way but it worked.

=IF(L3264<>"",HYPERLINK("path...\Job PO's 2021\PO "&A3264&"-signed.pdf",WORKDAY(J3264,5,)),HYPERLINK("path...\Job PO's 2021\PO "&A3264&".pdf",WORKDAY(J3264,5,)))
 

smozgur

BatCoder
Joined
Feb 28, 2002
Messages
1,538
Your solution is perfectly fine and thanks for sharing your solution.

One suggestion maybe: HYPERLINK function's link location parameter is a string, and you need to add the "-signed" suffix in a certain condition. So, instead of using two HYPERLINK functions, you can use the IF function when you create the link location string which will make your function shorter.

Excel Formula:
=HYPERLINK("path...\Job PO's 2021\PO " & A3263 & IF(L3264<>"","-signed","") & ".pdf",WORKDAY(J3263,5,))
 
Solution

Kiloelectronvolt

Board Regular
Joined
Oct 5, 2015
Messages
61
Office Version
  1. 365
Platform
  1. Windows
Your solution is perfectly fine and thanks for sharing your solution.

One suggestion maybe: HYPERLINK function's link location parameter is a string, and you need to add the "-signed" suffix in a certain condition. So, instead of using two HYPERLINK functions, you can use the IF function when you create the link location string which will make your function shorter.

Excel Formula:
=HYPERLINK("path...\Job PO's 2021\PO " & A3263 & IF(L3264<>"","-signed","") & ".pdf",WORKDAY(J3263,5,))
Much cleaner! I figured there was a better formula available, but I wasn't going to figure that one out. Thank you!
 

Forum statistics

Threads
1,141,127
Messages
5,704,442
Members
421,349
Latest member
Santhosh3188

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
Top