+ Reply to Thread
Results 1 to 6 of 6

VLOOKUP not returning desired result

  1. #1
    Registered User
    Join Date
    04-30-2014
    Location
    Durham, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    VLOOKUP not returning desired result

    hello hivemind,

    I have a workbook which includes references to other sheets within the book, but for the purposes of simplicity I have added an example in one sheet here.

    I have a cell which displays the tab name which is derived from a formula.

    From there I want to use a Vlookup to show information in a given array, but when I use my formula I get a #NA error. I can reference a cell that has the information typed in it and it works, but I can't point the vlookup to the formula'd cell and for it to know I want it to use the result of the formula to determine the value I want to see for the lookup.

    Does that make sense?

    I'd be grateful if someone can offer a solution that will allow me to continue referencing the tab name so that the multiple tabs I have to manage can be automated please.

    TIA,
    Suzi
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: VLOOKUP not returning desired result

    Hi Suzi,

    Two problems here. The 201 in row 1 in TEXT while the 201 in row 2 is a number. Tab names must be TEXT not numbers. The second is to lookup stuff from another sheet, as a variable, you need to use the INDIRECT() formula. Read about it at:
    https://exceljet.net/formula/lookup-...ble-sheet-name
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,147

    Re: VLOOKUP not returning desired result

    in C1

    =--MID(CELL("filename",C1),FIND("]",CELL("filename",C1))+1,255)

    converts to number

    to access a worksheet

    =VLOOKUP(C1,INDIRECT("'" & A1 & "'!A2:C100"),2,0)

    A1 has sheet name
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: VLOOKUP not returning desired result

    C1=MID(CELL("filename",C1),FIND("]",CELL("filename",C1))+1,255)+0

    Now C1 is a number.

  5. #5
    Registered User
    Join Date
    04-30-2014
    Location
    Durham, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: VLOOKUP not returning desired result

    Thank you everyone!

    Caracalla's reply fixed it by turning the cell from text into a value which the lookup can now read!

    Thank you! Thank you! Thank you!

  6. #6
    Registered User
    Join Date
    04-30-2014
    Location
    Durham, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: VLOOKUP not returning desired result

    Quote Originally Posted by JohnTopley View Post
    in C1

    =--MID(CELL("filename",C1),FIND("]",CELL("filename",C1))+1,255)

    converts to number

    to access a worksheet

    =VLOOKUP(C1,INDIRECT("'" & A1 & "'!A2:C100"),2,0)

    A1 has sheet name
    Thank you, I'll check that out too

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 10-27-2020, 08:27 AM
  2. [SOLVED] VBA VLookup not returning desired results
    By jsmilke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2016, 08:07 PM
  3. [SOLVED] Index match not returning the desired result - help appreciated
    By sipa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-13-2014, 10:41 AM
  4. [SOLVED] Need help on VLookup to find result based on desired number
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2013, 08:54 PM
  5. IF and SUM not returning desired result
    By SRussell in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-05-2008, 03:59 PM
  6. [SOLVED] vlookup returning a n/a result
    By JE McGimpsey in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 07:05 AM
  7. vlookup returning a n/a result
    By jeanette.rimmer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

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