+ Reply to Thread
Results 1 to 8 of 8

Lookup value is wrong

  1. #1
    Registered User
    Join Date
    07-06-2011
    Location
    salem, or
    MS-Off Ver
    Excel 2010
    Posts
    11

    Lookup value is wrong

    I am working from two worksheet.
    Collection Worksheet is an input worksheet. I type in the gathered information. Column D contains a drop down list of names.
    Information Worksheet contains list of student names (column e) and graduating year "Column D".

    On the collection sheet next to the names, I want to autofill the graduating year.

    I have used this formula, but it returns the wrong graduating year.

    =LOOKUP(D26,'Individual names'!E20:E102,'Individual names'!D20:D102)

    What am I doing wrong?

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Lookup value is wrong

    is the list in 'Individual names'!E20:E102 sorted ascending? as required for lookup to work?
    if not then use index match instead

    =index('Individual names'!D20:D102,match(D26,'Individual names'!E20:E102,0))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953

    Re: Lookup value is wrong

    To attach a Workbook
    (please do not post pictures of worksheets)
    • Click Advanced (next to quick post),
    • Scroll down until you see "Manage Attachments",
    • Click that then select "add files" (top right corner).
    • Click "Select Files" find your file, click "open" click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Click "Done" at bottom right to close the Attachment Manager.
    • Click "Submit Reply"
    Ben Van Johnson

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Lookup value is wrong

    I'd go with INDEX/MATCH

    =INDEX('Individual names'!D20:D102,MATCH(D26,'Individual names'!E20:E102,0))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Forum Contributor vamosj's Avatar
    Join Date
    04-23-2004
    Location
    Oregon
    MS-Off Ver
    2010
    Posts
    294

    Re: Lookup value is wrong

    Are the names placed in Column E set in Ascending order?
    Janos S. Vamos
    Data Systems Technician/Fire Controlman PO1(SW/AW)
    US Navy Retired


    Remember, Record Macro can be your friend for figuring out solutions.

    Good or Bad, let me know how I did by clicking on the "Add Reputation" * just to the lower left of here. it only takes a few seconds to let someone know.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Lookup value is wrong

    You probably also need to lock down the references with $

    =LOOKUP(D26,'Individual names'!E$20:E$102,'Individual names'!D$20:D$102)

    or for the index/match

    =index('Individual names'!D$20:D$102,match(D26,'Individual names'!E$20:E$102,0))

  7. #7
    Registered User
    Join Date
    07-06-2011
    Location
    salem, or
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Lookup value is wrong

    Both Worked. Thanks!

    Quote Originally Posted by Ace_XL View Post
    I'd go with INDEX/MATCH

    =INDEX('Individual names'!D20:D102,MATCH(D26,'Individual names'!E20:E102,0))

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Lookup value is wrong

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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 Gives Wrong Value?
    By soloProgrammer in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-26-2013, 01:14 PM
  2. Wrong result using v-lookup
    By Marvo in forum Excel General
    Replies: 7
    Last Post: 01-12-2012, 12:57 PM
  3. Lookup Function - Gives Wrong Value
    By saleh_binmasood in forum Excel General
    Replies: 10
    Last Post: 01-02-2011, 05:09 AM
  4. my lookup formula is wrong :-(
    By burnsie in forum Excel General
    Replies: 1
    Last Post: 11-03-2009, 08:20 AM
  5. Lookup returns wrong value
    By motorjobs in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2006, 06:49 PM

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