+ Reply to Thread
Results 1 to 5 of 5

Formula to use vlookup and hyperlink

  1. #1
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    60

    Formula to use vlookup and hyperlink

    A buddy of mine asked me to help him and I am currently stuck.


    Worksheet 1 is named Outputs. Worksheet 2 is named CustomerSalesData.

    - In D7 on the Outputs sheet, the user can input a customer ID number.
    - D9 on the Outputs sheet contains the following formula: =IF(D7="","",VLOOKUP(D7, CustomerSalesData!A2:CK6001, 89, FALSE)) This displays the account manager responsible for the account.

    - Column A on the CustomerSalesData tab contains all of the Customer ID numbers
    - Column CK on the CustomerSalesData tab contains all of the account managers names. This is the 89th column in the sheet which makes the above VLOOKUP formula work.

    Here's the problem....

    - In D10 on the Outputs tab, I want to put a link that says "Click here to change account manager." This link should take me to the account manager for that particular customer. For example, let's say this is my CustomerSalesData tab:

    Column A Column CK
    100 Adam
    200 Brad
    300 Chris
    400 Dan

    If 100 is entered in D7 on the Outputs sheet, the link in D10 should take me to the cell that says "Adam".
    If 200 is entered in D7 on the Outputs sheet, the link in D10 should take me to the cell that says "Brad".

    I've tried the following: =HYPERLINK(VLOOKUP(D7,CustomerSalesData!A2:CK6001,89,FALSE),"Click here to change account manager") but I get "Cannot open the specified file".

    Anyone know what I'm doing wrong here? Anything I need to be more clear on? Thanks in advance!

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

    Re: Formula to use vlookup and hyperlink

    Try:

    =HYPERLINK("#CustomerSalesData!CK"&MATCH(D7,CustomerSalesData!A:A,0),"Click here to change account manager")
    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
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Formula to use vlookup and hyperlink

    I think this worked. I am waiting to hear back to see if it did the job completely. For my own reference, what does putting the # sign do?

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

    Re: Formula to use vlookup and hyperlink

    It is used in order to avoid inserting the path in the formula..

    for example you can also use:

    =HYPERLINK("[book2.xlsx]CustomerSalesData!CK"&MATCH(D7,CustomerSalesData!A:A,0),"Click here to change account manager")

    where book2.xlsx is the name of the workbook you are in...

    it just means "in this workbook", in this case...

  5. #5
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Formula to use vlookup and hyperlink

    Alright, that helps. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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