0

I have the following formula which outputs a value from another sheet. This is functioning just as it should.

=IFERROR(INDEX(Planner!$B$11:$B$164,SMALL(IF(($F$4=Planner!$A$11:$A$330),ROW(Planner!$A$11:$A$308)-MIN(ROW(Planner!$B$11:$B$373))+1,""),ROWS($A$1:A1))),"")

The formula and functions above are new to me, so I am not entirely sure how to add a link.

The formula above is looping through the data I have to check if the row has $F$4 in it, so adding the hyperlink is a bit more complex.

How can I add a hyperlink to the output, so that it will hyperlink to where the source cell?

I have tried the following. Upon initial completion of the formula and entering "Ctrl+Shift+Enter", a file window opens like I am trying to open a new file. However, when I click on the cell after, it does nothing. I have Excel 2016

=HYPERLINK("#Planner!B"  &  SMALL(IF($F$4=Planner!$A$11:$A$330,ROW(Planner!$A$11:$A$308)-MIN(ROW(Planner!$B$11:$B$373))+1,""),ROWS(Sheet1!$A$1:A1))+10,  IFERROR(INDEX(Planner!$B$11:$B$164,
SMALL(IF(($F$4=Planner!$A$11:$A$330),ROW(Planner!$A$11:$A$308)-MIN(ROW(Planner!$B$11:$B$373))+1,""),ROWS($A$1:A1))),""))

Main sheet

enter image description here

Planner Sheet

enter image description here

12
  • If you carve out the first half of your equation, do you get a cell reference? It doesn't seem like what you have would do that. I think you need index() in there somewhere.
    – gns100
    Commented Sep 1, 2022 at 16:16
  • @gns100 Which part specifically? Commented Sep 1, 2022 at 16:44
  • Sorry for not being clear. The hyperlink formula requires a cell reference or URL, so is that part of your really a cell reference? Specifically this part="#Planner!B" & SMALL(IF($F$4=Planner!$A$11:$A$330,ROW(Planner!$A$11:$A$308)-MIN(ROW(Planner!$B$11:$B$373))+1,""),ROWS(Sheet1!$A$1:A1))+10
    – gns100
    Commented Sep 1, 2022 at 16:59
  • @gns100 When I do that the referred cell appears. This is exactly what populated.... #Planner!B13 Commented Sep 1, 2022 at 17:04
  • I had to check, it looks like you need the file name in there too. So put in [file name] in front of the # symbol. Make sure to use the brackets.
    – gns100
    Commented Sep 1, 2022 at 19:22

1 Answer 1

0
=HYPERLINK("#"  &  ADDRESS(MATCH(Planner!$F$4,Planner!$A$11:$A$164,0)+10,1,,,"Planner"),  IFERROR(INDEX(Planner!$B$11:$B$164,SMALL(IF((Planner!$F$4=Planner!$A$11:$A$330),ROW(Planner!$A$11:$A$308)-MIN(ROW(Planner!$B$11:$B$373))+1,""),ROWS($A$1:A1))),""))

Perhaps I greatly misunderstand, but nothing I see in the question or comments seems to contradict the first line in the question that says the sheet is in the same spreadsheet. So paths and filenames seem unnecessary.

So, instead of thinking of generating the value and then hyperlinking it, think in terms of generating an address for the hyperlink function to act upon achieving the hyperlinking action, and use HYPERLINK's second parameter, that of a "friendly name" to display in the cell for the formula you give that generates the value.

So your value will display in the cell, but clicking on it will activate the hyperlink to go to the generated address.

Speaking of which, I suppose there is some reason for the curious way you generate the lookup. I suppose that because you use a variety of ranges in the formula that differ from each other in that they use different, and different size, sets of rows where a lookup like XLOOKUP would have the ranges rather more in lockstep. I guess. Not asking. But because the given formula is essentially a simple lookup, for the demonstration of the solution, I used a simple MATCH of F4 on the column A range to generate the row number (the result plus the 10 rows not included before the range starts) and a simple 1 for the column in the ADDRESS function. This will actually work for your situation no matter the reason for your unique lookup mechanism, as the address you want is the simple MATCH I did anyway.

The only complication in the ADDRESS function is that the place you want the hyperlink to take you is on sheet Planner so you must specify that as ADDRESS's final parameter.

To recap, HYPERLINK will use the ADDRESS and MATCH mechanism to create the address to link to. It will also generate a "friendly name" for display in the cell that just happens to be the value your lookup finds. So you display the value you wish to display, but have a working hyperlink to take you to the source.

NOTE: Sadly, you cannot place a similar mechanism in the cells you go to thinking to then click those hyperlinks to return to the places you started. Excel will see it as an infinite loop and quit, giving you an error. But you can use this technique in a cell next to this one's target (and therefore easy to click after looking at the target) which can return you. The fact that the cell right next to this one's target may have nothing at all to do with the situation doesn't matter. It is conveniently close to the user's visual attention center (the target of this hyperlink) so no aggravation for him to click the cell next to it to return to his starting place.

1
  • Thanks for submitting the answer. This does not appear to be doing the trick. The output now shows #N/A and the link doesn't work. Commented Sep 6, 2022 at 14:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .