+ Reply to Thread
Results 1 to 12 of 12

Excel VLOOKUP

  1. #1
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Excel VLOOKUP

    In my original thread I had a database that was only about 1600 lines. The orginal file worked fine when I made the suggested correction of converting the column to numbers. I now have a much larger database to work with, consisting of over 49000 lines. I need to confine the array to be between, Sheet2!A2:Sheet2!D2649.

    I am listing two lines, the first works, the second does not, They both gave the required result in the first file.

    Works:
    =VLOOKUP($A2,Sheet2!A2:Sheet2!D2649,2,FALSE)

    Result: Cover Assy, Tank, Solution Fill

    Doesn't work:
    =VLOOKUP($A13799,Sheet2!A13799:Sheet2!D16446,2,FALSE)

    Desired Result: FAN, VACUUM, 5.1D, 120VAC, 1 STAGE [TF]
    Result given: #N/A

    I notice that the array searches progressively, thus searching for data where there would be non. How can I restrict this search?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Excel VLOOKUP

    vlookup() only takes 1 array, you have a single cell ref at the start (A13799) what are you trying to do with that? try and remove it and see if it works then

    edit: umm duh, sorry. brain freeze (my only excuse is that i just woke up) sorry.
    maybe its because the cell you are searching for is inside the range you are looking at?
    Last edited by FDibbins; 06-18-2012 at 01:03 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: Excel VLOOKUP

    Hi There,

    If the data you need is just between Sheet2!A2:Sheet2!D2649 then why dont try this and drag it till your requirements. The "$" sign before the column name and row number would fix the column and row of your search


    Please Login or Register  to view this content.

    drag it till your requirements
    Thanks,

    Bonny Tycoon


  4. #4
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Excel VLOOKUP

    I have one page of data that is a complete list. I then have a second page of data that is the available list. I need list A to pull the matching data from list B, and make one row of correlated information.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Excel VLOOKUP

    From what you've described, Bonny's solution should work for you. Can you upload a dummy spreadsheet showing exactly what you are doing and what you expect? (Go Advanced>Manage Attachments)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  6. #6
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Excel VLOOKUP

    I have tried the $ correction suggested, but the problem is that the search progresses column and line past the area where the data is located. Say the data in sheet 1 is listed at A13799, and in sheet 2 that same data is located at A1650, the VLOOKUP (as it progresses from A3 down only searches accordingly on sheet 2) SO, the data I am searching for, is before where the VLOOKUP is looking at sheet 2. I need my search to be restricted to just one area, and not grow with every line in sheet 1.

  7. #7
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: Excel VLOOKUP

    I believe we all would need an example spreadsheet to understand and fix your issue.

    Can you follow ChemistB steps and upload your file. Thanks

  8. #8
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Excel VLOOKUP

    I have attached part of the file. The whole file is too large to upload.
    Attached Files Attached Files

  9. #9
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: Excel VLOOKUP

    So does the partial file mean that it would search A1 in column M and should display the corresponding value in column N?

    Would you run the formula on sheet1 or Sheet2.

    I would suggest send an example sheet the way it looks (example: some data on Sheet1 and some on Sheet2, where would you run the formula and some comments)

    Its a bit hard to interpret your query with your above posts.

  10. #10
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Excel VLOOKUP

    To begin, sorry about the upload. When I copied part of the file, pasted in a new one to make it short enough to upload is screwed it all up.

    The term partial was used because I was limited to the size of file that I could upload, and I didn't want it confused with what I am working on.
    Realize that the file is 49000 lines long on sheet 1

    Sheet 2 contains the data I want to search

    Cell K2 of the file I am working on contains the formula =VLOOKUP(A2,Sheet2!$A2:Sheet2!$D2649,2,FALSE)
    This returns the desired answer

    random cell in column K shows a formula of =VLOOKUP($A57,Sheet2!$A57:Sheet2!$D2704,2,FALSE)
    Which, you can see, no longer begins it's search at sheet2!A2
    It Begins the search at sheet2!A57

    I need the search to be confined, and not grow progressively so that the search perameters are kept, even at line 48999

    I have fixed a couple of lines close to that limit, and refined the array to reflect the data I want searched, and got the answer I desired, but if I copy/paste the formula to the entire column, cell by cell, it changes.

    Example of what worked:
    =VLOOKUP($A13799,Sheet2!$A2:Sheet2!$D2649,2,FALSE)

    Returned the description that matched

    HOWEVER, the line above it was not corrected, and did NOT return a result -

    Example
    =VLOOKUP($A13798,Sheet2!$A13798:Sheet2!$D16445,2,FALSE)


    So, do I go line by line, 49000 times and correct the search array?

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Excel VLOOKUP

    What you need to do, in K2, the first formula is anchor the rows.

    You have Sheet2!$A2:Sheet2!$D2649,
    what you want is
    Sheet2!$A$2:Sheet2!$D$2649, then when you drag, that range will stay constant.
    As an aside, you also don't need the second "Sheet2!"
    =VLOOKUP(A2,Sheet2!$A$2:$D$2649,2,FALSE)
    Hope that helps.

  12. #12
    Registered User
    Join Date
    06-13-2012
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Excel VLOOKUP

    Thank You ChemistB THAT is the answer... I was wanting to anchor the search. Once that was done, the appropriate data matched, and I could move to the next column making minor changes, and the formula continued to work. Now when I get my next three databases, I should be able to make it all match.

    Thank You Bonny, and ChemistB for helping me understand the subtle changes I needed to make, for this to work.

+ 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