Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Combining =HYPERLINK() & =LOOKUP() in Excel

Posted on 2011-03-21
7
Medium Priority
?
280 Views
Last Modified: 2012-05-11
Hello,

This is a follow-up question to two other threads which can be found here:

    1)  Determining the correct argument for =HYPERLINK() in Excel
    2)  Understanding the syntax in =HYPERLINK() in Excel

In the two files attached to this question:

    File1 has a some entries in col B under the heading "Num."  Col C has the heading "Link" but no data yet.
    File2\SheetA has entries in col E and col F under the headings "Num" and "Row" respectively

I have written a formula in File1 which works successfully to lookup data from File2\SheetA (it's off to the side in col F):

    =LOOKUP(B3,[File2.xlsx]SheetA!$E$2:$E$15,[File2.xlsx]SheetA!$F$2:$F$15)

in which:

    the lookup_value comes from File1:col B
    the lookup_vector is File2SheetA:col E
    the result_vector is  File2SheetA:col F

For simplicity, I will refer to this =LOOKUP() formula as L-Fxn.

Now, in File1:col C, under the heading "Link," I want to use =HYPERLINK() to create a column of links, for which the targets will be in File2\SheetB and have a cell reference in which the column is col A and the row is defined by L-Fxn.  In other words, for any value in File1:col B, I want to be able to click an adjacent link in col C and have it take me to the col A cell of a row in File2\SheetB defined by the data in File2\SheetB (cell reference = A&L-Fxn).

Example:

    File1:cell B3 value = 1629
        In File2\SheetB, the value 1629 is found in cell B4
        Cell C4 value = 604
    Therefore, the link in File1:cell C3
        should take me to File2\SheetB:cellA604

I've written plenty of =HYPERLINK() formulas in the past and I've tried several different changes to get it right but keep getting an error.  I think the tricky part is plugging in L-Fxn with the correct quotation marks, etc.  If someone could bail me out, I'd appreciate it.

Thanks
 File1.xlsm File2.xlsm
0
Comment
Question by:Steve_Brady
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 7

Accepted Solution

by:
Jignesh Thar earned 1000 total points
ID: 35189460
Steve - Try below in C3 of File1.xlsm.Sheet1. I tested and it works

=HYPERLINK(CONCATENATE("[File2.xlsm]SheetA!A",VLOOKUP(B3,[File2.xlsm]SheetA!$B:$C,2)),"Link")
0
 
LVL 19

Assisted Solution

by:Arno Koster
Arno Koster earned 1000 total points
ID: 35189499
Usign cell functions, the lookup command can only return values from File2.xlsm that are adjecent to the search value. Therefor, you could add (in file2.xlsm) a column with numbers representing the row :


<b>    <c>   <d>
Num      Row      Position
1627      228      2
1628      596      3
1629      604      4
1630      612      5
1631      660      6
1632      636      7
1634      668      8
1635      676      9
1636      684      10
1638      692      11
1639      700      12
1641      732      13
1642      724      14
1643      740      15

The use the lookup function to return the position :

=LOOKUP(B3,[File2.xlsx]SheetA!$B$2:$B$15,[File2.xlsx]SheetA!$D$2:$D$15)
(this would return 4)

and use it to formulate the lookup function.

normally, the function

=HYPERLINK("[path\file2.xlsm]SheetA!C7"; "link")

Open in new window

would generate a hyperlink with the text 'link' to cell C7.

=HYPERLINK("[path\file2.xlsm]SheetA!C" & C11; "link")

Open in new window

would link to cell C5 in file2.xlsm when the value 5  is intered in cell C11 in file1.xlsm

but when using
=HYPERLINK("[path\file2.xlsm]SheetA!C" & LOOKUP(B3;'[path\File2.xlsm]SheetA'!$B$2:$B$15;'[path\File2.xlsm]SheetA'!$C$2:$C$15); "link")

Open in new window

strangely this leads to a hyperlink that does not work

What does work however, is using the D column in file1 for this formula :
eg in D3
="[path\file2.xlsm]SheetA!C" &        LOOKUP(B3;'[path\File2.xlsm]SheetA'!$B$2:$B$15;'[path\File2.xlsm]SheetA'!$D$2:$D$15)

Open in new window

and in C3 :
=HYPERLINK(D3; "link")

Open in new window



0
 
LVL 19

Expert Comment

by:Arno Koster
ID: 35189527
I seem to have missed the way you want the hyperlink to work, forget the D column in file2 and use


LOOKUP(B3;'[path\File2.xlsm]SheetA'!$B$2:$B$15;'[path\File2.xlsm]SheetA'!$C$2:$C$15) as before...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Expert Comment

by:Jignesh Thar
ID: 35189551
It worked for me if I use Concetenate function.
0
 
LVL 19

Expert Comment

by:Arno Koster
ID: 35189738
jigneshthar,

i missed you comment while typing mine, sorry !
0
 
LVL 7

Expert Comment

by:Jignesh Thar
ID: 35189773
No offense as this happens almost every other time with all of us :-)

Just wanted to highlight that I could see this working with single formula.
0
 

Author Closing Comment

by:Steve_Brady
ID: 35420672
Thqanks!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a serious pitfall that can happen when deleting shapes using VBA.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question