+ Reply to Thread
Results 1 to 6 of 6

Lookup functions not working

  1. #1
    Forum Contributor
    Join Date
    09-05-2007
    Posts
    148

    Lookup functions not working

    I am trying to use a lookup function, something i have done many times before.

    I have a list called lookup list and another called data list.

    I basically need to look at the first entry in the lookup list and check if it appears anywhere in the data list. That's all i need.

    Problem is, sometimes lookups don't work, and when they do work, they just return a value that isn't even in the sheet!

    This is something i do at work and i have a feeling that because most of my data comes of cognos or SAP, the formatting is messing with my formulas but it's just a theory.


    I have included a file with data, any help would be great.
    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,169

    Re: Lookup functions not working

    Hi,
    The dollar signs (you don't have any) are getting you. You have:
    =LOOKUP(D5,B5:B1793)
    and may need.
    =LOOKUP(D5,B$5:B$1793)
    Then there is another argument in lookup telling it to only return exact matches. Otherwise it returns the first value less than the lookuped search.

    Try using VLookup( ) with the third argument asking for EXACT match.
    http://www.techonthenet.com/excel/formulas/vlookup.php
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    09-05-2007
    Posts
    148

    Re: Lookup functions not working

    Hi, it's not the dollar signs. I know i need to use those when dragging the formula down for all of the values in lookup list, but in the sheet i uploaded, the lookup doesn't even work for the first value.

    Thanks for replying though, forgetting the dollar signs has caught me out before, but unfortunately in this case i can't even get that far.

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

    Re: Lookup functions not working

    Try:

    =ISNUMBER(MATCH(D5,$B$5:$B$1793,0))

    this returns TRUE next to the column D cell, if a match is found and FALSE if not found.
    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.

  5. #5
    Forum Contributor
    Join Date
    09-05-2007
    Posts
    148

    Re: Lookup functions not working

    Nice, that seems to work. Could you please explain what's happening a little bit?

    I use the isnumber function on my data and it returns false, so my data is not being looked at as numbers by Excel. How does your formula overide this?

    Also, how would i turn my values into numbers (if there's a way)?


    Thanks

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

    Re: Lookup functions not working

    The first part of the formula to get evaluated is the MATCH function... Match looks for a match for a given value in a given 1 dimensional array. It returns the position number within that array where the match occurs. If a match does not occur, then you will get an #N/A error. The ISNUMBER() part simply checks if Match returned a number (to indicate a match is found) and results in TRUE if it is found.

    If you want the actual value matched returned you could add the INDEX function

    =IFERROR(INDEX($B$5:$B$1793,MATCH(D5,$B$5:$B$1793,0)),"")

+ 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