Issue with hyperlink formula when a space character is in the destination worksheet name

SerenityNetworks

Board Regular
Joined
Aug 13, 2009
Messages
131
Office Version
  1. 365
Platform
  1. Windows
I'm using the formula below to create a hyperlink to another worksheet in the same workbook. The formula parses out the destination worksheet from another cell (A12 in the example below) using the carat delimiter. The formula works perfectly as long as the destination worksheet does not have any space characters in the worksheet name. Once a space is added in a worksheet name then the formula fails (with "Reference isn't valid."). I've tried escaping the double quotes in the formula and I've tried substituting the space character with CHAR(32), but either that's wrong or I'm screwing up the implementation. I'd appreciate any help in fixing the formula.


Thanks in advance,
Andrew

=IFERROR(HYPERLINK("#"&MID($A12,FIND(CHAR(1),SUBSTITUTE($A12,"^",CHAR(1),11))+1,50)&"!a1",MID($A12,FIND(CHAR(1),SUBSTITUTE($A12,"^",CHAR(1),11))+1,50)),"")
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Whoops! I forgot that it is single quotes that need to be used when a worksheet name contains spaces.

Answer:
=HYPERLINK("#'"&MID($A11,FIND(CHAR(1),SUBSTITUTE($A11,"^",CHAR(1),11))+1,31)&"'!A1",MID($A11,FIND(CHAR(1),SUBSTITUTE($A11,"^",CHAR(1),11))+1,31))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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