+ Reply to Thread
Results 1 to 10 of 10

=Lookup function not working, are there alternatives?

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    =Lookup function not working, are there alternatives?

    Hi,

    I'm trying to do a lookup. User will enter an account number which can be all numerica or alpha numeric. I then need to do a lookup to a large table based on their entry. When the lookup finds a match in A:A of the table, I need it to return the value in column N.

    The table can contain multiple instances of the account number, but the value in column N will always be the same.......so all I really need Excel to do is fine the first instance of the account number, and return the value in column N of that field.

    I've tried using =LOOKUP(C1,'Sheet1'!A:A,'Sheet1'!N:N) The result is inconsistant and not always correct. I've tried sorting my table by Column A, I've tried formatting the field as number, text, general....it remains inconsistant.

    Is there another formula to find and return the information in Column N that I need, or am I just doing something wrong? I've used Lookups quite a bit, but Excel sometimes gets tempermental with them.

    Thanks,
    Ben

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: =Lookup function not working, are there alternatives?

    You get better help, if you add an example file, without confidentional information.

    Please also add the desired result.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: =Lookup function not working, are there alternatives?

    HI Ben,


    Welcome to the forum.
    Suggest you to upload a sample workbook along with your expected results. thanks

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Registered User
    Join Date
    01-16-2013
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: =Lookup function not working, are there alternatives?

    Thanks...I've uploaded a sample Excel document. In this, in the "Est to Actual Compare' tab, user will enter an account number in Cell C1. Cell I1 contains the lookup formula, which reads from tab CMPM Data.

    What I want this to do is whatever value is in C1, then lookup in A:A of the CMPM Data and find a match. When a match is found, then return whatever value is in column N.

    In the uploaded sample Excel I have entered account 221051. It's a valid account in column A:A of CMPM Data, and it should return an "N" from Column N, however I'm getting #N/A.

    If I try entering 126812 in cell C1....it returns the value in column N correctly.

    I can't figure out why it works some of the time, but not all. Is there another way to search column A:A based on entry in Cell C1, and have Excel return the associated value in Column N?

    Thanks, appreciate your help!
    - Ben
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: =Lookup function not working, are there alternatives?

    See the attached file, for the right formula.

    N/A means the value is not found.

    the value 221051 is not found in the range.

    TIP => you worked with merged cells.

    Don't do that, you get in trouble with it sooner or later.
    Attached Files Attached Files
    Last edited by oeldere; 01-16-2013 at 12:55 PM. Reason: TIP etc

  6. #6
    Registered User
    Join Date
    01-16-2013
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: =Lookup function not working, are there alternatives?

    Yes, I know #N/A means value is not found, but that is not correct for 221051. If you look in the table, value 221051 begins in Cell A165. Even in the vLookup formula you provided, it should capture 221051 correctly and return a 'N' from column N....but I'm still getting #N/A.

  7. #7
    Registered User
    Join Date
    01-16-2013
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: =Lookup function not working, are there alternatives?

    I believe this has something to do with formatting. If I copy 221051 from cell A165 and paste it into cell C1 where users will enter the account, I then get the correct outcome and it returns 'N'. If it is a formatting issue, my problem is I can set the format a certain way, but users may manually enter in C1 or they might copy/paste the number from another Excel document. I can't necessarily control the formatting because of this.

    Because of this, and if the Lookup functions require like formatting, I'm just wondering if there is another formula that could be used to find the Account number and then pull in the value of Column N in that same row.

  8. #8
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: =Lookup function not working, are there alternatives?

    the value in C1 on EST sheet is NUMBER, where as the values in column A on CMPM sheet are TEXT.

    if users are going to enter values in C1 on EST sheet, you could use the following formula to convert the value in C1 from NUMBER to TEXT, in which case you will not encounter an error:

    Please Login or Register  to view this content.
    Last edited by icestationzbra; 01-16-2013 at 01:25 PM.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: =Lookup function not working, are there alternatives?

    Paste this macro in your file an run it on the second sheet.

    Then the text in column A will return to number.

    After that, the VLookup function will work correctly.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    01-16-2013
    Location
    Oakland, CA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: =Lookup function not working, are there alternatives?

    icestationzbra...thanks so much!!! I tried the =Index formula and it seems to work correctly in all cases. Not only does it pick up correctly if Numeric only or Alpha-Numeric, but I can add additional spaces and it still works. This is great...you saved me a lot of headache!!!

    - Ben

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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