+ Reply to Thread
Results 1 to 14 of 14

Lookup returns blank even though lookup_value exists in lookup_vector

  1. #1
    Registered User
    Join Date
    03-25-2019
    Location
    Kinshasa, DRC
    MS-Off Ver
    2010
    Posts
    7

    Lookup returns blank even though lookup_value exists in lookup_vector

    Hi !

    I have a worksheet which needs to lookup certain value from another sheet on the same workbook. However, it is returning blank. The original sheet does have blank cells in the lookup_vector - so I tried filling up the list but still Im getting a blank result.

    Where the lookup formula is:
    (Note : the forumula was originally (=lookup(D9,Total SO DCL!$D$9:$D$10000,Total SO DCL!$A$9:$A$10000). But since that was also giving me blank results I tried the other way).

    Excel Query March 25, 2019 Page 1.JPG

    The lookup_vector it is referencing and the result_vector.Excel Query March 25, 2019 Page 2.JPG

    Ive used lookup many times. In fact, this workbook is full of lookup and VLookup formulae. But I cant for the life of me figure out why in this particular instance there are blank results.

    Help would be appreciated.

    Thanks a million.

    RikkiS

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,701

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    why not use just a vlookup formula or an Index Match formula instead?

    =vlookup(D9,'Total SO DCL'!$D$9:$M$10000,10,0)

    =index('Total SO DCL'!$M$9:$M$10000,match(D9,'Total SO DCL'!$D$9:$D$10000,0))

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    If you use LOOKUP (sometimes) the data has to be in order.
    You're better off changing them to VLOOKUP.

    You're even better off posting the file rather than images as we can't visually check that the data is what it looks like in an image.

    Post a sample spreadsheet with expected results, remove any sensitive data, create a mockup example if necessary.
    Use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments as the "paperclip" method does not work on this forum.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Registered User
    Join Date
    03-25-2019
    Location
    Kinshasa, DRC
    MS-Off Ver
    2010
    Posts
    7

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    Hi !

    Thanks for guiding me.

    Attached herewith the two sheets (one one workbook) -

    a. BDL sheet is where the formula is and I want the result.
    b. Total SO DCL is where the lookup_vector and result_vector is.
    c. I have filled yellow on the number '01674' which is the lookup_value and is there in the lookup_vector. I have marked 3/17/2019 in Blue which is the result I was expecting.

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    Wrong formula, As the column you want to retrieve is on the left of the lookup value use this instead

    =INDEX('Total SO DCL'!A$10:A$100000,MATCH(D9,'Total SO DCL'!$D$10:$D$10000,0),1)

    It should be VLOOKUP not LOOKUP and you can only retrieve values that are on the right of the first VLOOKUP column, so column D onwards.
    You want column A so you cant use VLOOKUP.

  7. #7
    Registered User
    Join Date
    03-25-2019
    Location
    Kinshasa, DRC
    MS-Off Ver
    2010
    Posts
    7

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    Are you saying that Lookup also has the same limitation as VLookup i.e. it cannot return values to the left of the lookup_vector?

  8. #8
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    I dont usually use LOOKUP so am not that familiar without, but I did a test and see what you mean and it does seem to work - but only if the data is sorted.

    According to this page

    the range has to be in order. It's not, there are spaces between each code in column D.

  9. #9
    Registered User
    Join Date
    03-25-2019
    Location
    Kinshasa, DRC
    MS-Off Ver
    2010
    Posts
    7

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    Thanks a million. Your suggested correction worked.

    Although......now, whenever there is no match, it returns #N/A (which is default in Excel - I know) and I wish it to remain blank if that is the case.

    In the past, I would use =if(A1<>"",A1,"") i.e. if A1 has a value, then A1, if it doesnt leave the cell blank. Even if I used formulae, if there was no result, it would leave the cell blank. not in this case. In fact, I tried using a second if function to see if the match wasnt there in the first array, was it there in the second? And it would still return N/A since it wasnt there in the first array(even though it was there in the second).

    I could use the sheet with the NA displaying - and work around that for the data that I actually need. But its just not very neat.

  10. #10
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    Use

    IFERROR(formula, "")

  11. #11
    Registered User
    Join Date
    03-25-2019
    Location
    Kinshasa, DRC
    MS-Off Ver
    2010
    Posts
    7

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    Thanks.

    I was able to find the ISNumber function which worked for me. But I think Iserror would have worked better. For next time.

    Thanks a million for your help.

  12. #12
    Registered User
    Join Date
    03-25-2019
    Location
    Kinshasa, DRC
    MS-Off Ver
    2010
    Posts
    7

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    To dosydos:

    Thanks. But the Vlookup wasnt working either. I ended up using the Index, Match function.

    Thanks.
    Last edited by RikkiS; 03-27-2019 at 03:27 AM. Reason: Did not quote original poster - was not clear who I was replying to.

  13. #13
    Registered User
    Join Date
    03-25-2019
    Location
    Kinshasa, DRC
    MS-Off Ver
    2010
    Posts
    7

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    Quote Originally Posted by dosydos View Post
    why not use just a vlookup formula or an Index Match formula instead?

    =vlookup(D9,'Total SO DCL'!$D$9:$M$10000,10,0)

    =index('Total SO DCL'!$M$9:$M$10000,match(D9,'Total SO DCL'!$D$9:$D$10000,0))
    Thanks. But the Vlookup wasnt working either.

    I ended up using the Index, Match function.

    Thanks for your help.

  14. #14
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Lookup returns blank even though lookup_value exists in lookup_vector

    Please try
    =IF(D9<>"",LOOKUP(2,1/('Total SO DCL'!$D$9:$D$10000=D9),'Total SO DCL'!$A$9:$A$10000),"")

+ 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. LOOKUP Other Occurrences of lookup_value
    By Thienzaw in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-19-2019, 11:12 PM
  2. Replies: 2
    Last Post: 05-05-2012, 10:57 AM
  3. Replies: 0
    Last Post: 02-15-2012, 12:26 PM
  4. Loookup(2,1/ lookup _Value, Lookup_Vector
    By Blake 7 in forum Excel General
    Replies: 7
    Last Post: 02-22-2011, 06:13 PM
  5. [SOLVED] Lookup:returns a blank
    By tracy in forum Excel General
    Replies: 8
    Last Post: 02-11-2006, 12:24 PM
  6. vlookup:same lookup_value, different returns
    By javino in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-15-2005, 09:00 PM
  7. How to make LOOKUP give zero if it can't find the lookup_value?
    By Dmitry Kopnichev in forum Excel General
    Replies: 3
    Last Post: 10-12-2005, 05:05 PM

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