+ Reply to Thread
Results 1 to 7 of 7

conditional hyperlink to different sheet

  1. #1
    Registered User
    Join Date
    02-27-2008
    Location
    Irving, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    96

    conditional hyperlink to different sheet

    Hi all,

    This one seems straight forward, but I can't get it to work. I have a list of numbers in a pivot table and a count of the occurrence of those numbers as the data in the table. If there are repeats of the number, I want to do a MATCH for the number in the pivot table's data list, and provide a link to the row on that list sheet. The number is in column B, the count of it's occurrence is in column J. The column to match against on Sheet1 is K.

    Here's what I've tried:

    Please Login or Register  to view this content.

    This creates text when I want to in the correct cells, and the text is blue and underlined as if it's a correct hyperlink. But when I click on it, it says I can't open the file, even though I'm currently in the file. If I select a different cell and just use the right-click Add Hyperlink functionality, I can happily link to the exact same desired cell. This doesn't work, though, if I want them to be conditional, and I don't want to have to add hundreds of links manually.

    Does anyone have any advice?

    Thanks,
    Adam
    Last edited by ahartman; 03-17-2010 at 11:45 AM. Reason: SOLVED
    -Adam Hartman
    Mechanical Engineer

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: conditional hyperlink to different sheet

    Try:

    =IF(J42>1,HYPERLINK("#Sheet1!A"&MATCH(B42,Sheet1!K:K,0)&"","# " & B42),"")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    02-27-2008
    Location
    Irving, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    96

    Re: conditional hyperlink to different sheet

    Quote Originally Posted by NBVC View Post
    Try:

    =IF(J42>1,HYPERLINK("#Sheet1!A"&MATCH(B42,Sheet1!K:K,0)&"","# " & B42),"")
    That didn't work, saying the reference was not valid. I've sanitized the names of the sheets in this post, and have found that if I try to do the same logic but with a one word sheet name, i.e. "Sheet1" but not "Sheet 1", then it works fine. I think that means I'm missing quotes or something to let excel know the full name of the sheet. Any suggestions there? For example, assume the sheet name to be linked to is "ABC XYZ 123"...

    -Adam

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: conditional hyperlink to different sheet

    Try:

    =IF(J42>1,HYPERLINK("#'Sheet 1'!A"&MATCH(B42,'Sheet 1'!K:K,0),"# " & B42),"")

    you need single apostrophe's in there when referencing sheetnames with spaces or special characters.

  5. #5
    Registered User
    Join Date
    02-27-2008
    Location
    Irving, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    96

    Re: conditional hyperlink to different sheet

    Quote Originally Posted by NBVC View Post
    Try:

    =IF(J42>1,HYPERLINK("#'Sheet 1'!A"&MATCH(B42,'Sheet 1'!K:K,0),"# " & B42),"")

    you need single apostrophe's in there when referencing sheetnames with spaces or special characters.
    Eureka! The part I would have never gotten was the "# at the beginning. What's that about?

    -Adam

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: conditional hyperlink to different sheet

    It is needed when you are hyperlinking to a place within the workbook when you are "indirectly" hyperlinking to that cell (i.e. using a formula to arrive at the cell to hyperlink to).

  7. #7
    Registered User
    Join Date
    02-27-2008
    Location
    Irving, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    96

    Re: conditional hyperlink to different sheet

    Yay for MS not mentioning this in the help file!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1