+ Reply to Thread
Results 1 to 5 of 5

Vlookup issue

  1. #1
    Registered User
    Join Date
    01-30-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    37

    Vlookup issue

    I have the attached workbook.
    I have one sheet (materials) using Vlookup onto a second sheet (price list).

    If I put in a qty against 2 or more items with the same part code on the price list only the first item is displayed. It does get shown multiple times.

    I need to try and get all items displayed, even if the part code is the same.

    Please look at attached workbook with sample already shown.

    Thanks for your help
    Attached Files Attached Files
    Last edited by philiasfogg; 10-26-2009 at 06:44 AM.

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

    Re: Vlookup issue

    Because your Price List database is large, try not to use array formulas.. so instead add a helper column in column I... use formula in I11: =IF(ISNUMBER(F11),MAX(I$10:I10)+1,0)

    and copy right down.

    Then in Materials sheet...C20, use:

    =IF(ROWS($A$1:$A1)>$C$18,"",INDEX('price list'!B$5:B$6674,MATCH(ROWS($A$1:$A1),'price list'!$I$5:$I$6674,0)))

    and copy across to column F

    you will need just change the indexed ranges in E and F to get proper info..

    Then copy all down.
    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.

  3. #3
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Vlookup issue

    NBVC is 100% correct. You'll get a faster loading of the page and less buggy sheet if you don't use arrays. The index matching combination will do the trick for both data requirements, now if you are afraid of changing that you can just place this formula on F20
    =IF($D20="","",SUMPRODUCT(--('price list'!$C$13:$C$6674=$D20),'price list'!$F$13:$F$6674))

    and copy down.

    Ron

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Vlookup issue

    To eliminate the need for the hefty arrays, I added an indexing key to your "pricelist" in column I. You can hide that column if you wish.

    Now, the items are brought into the estimate by that index, in order, rather than by array evaluation. So the sheet will never experience any performance issue AND all the items will transfer over based solely on whether there is a QTY or not.

    All the formulas are now simple INDEX/MATCH.


    EDIT:
    Late to the party, I see that my answer matches NBVC with the exception I wouldn't use MAX() over and over in column I as that keeps evaluating the whole column all over again and all you need to look at is the one cell above.

    I can't see an advantage to using SUMPRODUCT() over INDEX/MATCH.
    Attached Files Attached Files
    Last edited by NBVC; 10-24-2009 at 09:13 PM. Reason: Fixed incorrect spelling of my name.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Registered User
    Join Date
    01-30-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    37

    Re: Vlookup issue

    Thanks for all your help.
    These answers have helped me resolve the issue

+ 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