+ Reply to Thread
Results 1 to 7 of 7

sumif with nested vlookup

  1. #1
    Registered User
    Join Date
    08-01-2007
    Posts
    15

    sumif with nested vlookup

    Hi,

    I have a spreadsheet that contains the full list all of our items in inventory.
    For each job, I import a list of items and quanity of each item used.

    On the inventory list I am using vlookup to match up the items in the import sheet and display the quanity.

    Please Login or Register  to view this content.
    So far so good but now i realize that I will sometimes have more than one entry on the import sheet that matches the criteria. Now I need the total to add all matching items.

    I can use sumif on the import page but it would be alot cleaner if it could be accomplished in combination with the vlookup.

    Thanks in advance for any ideas.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Find many Values of the same criteria

    Here's a function from the Oz you can paste into a regular module
    Please Login or Register  to view this content.
    similar to the vlookup function your formula will be
    =FindNth($A$4:$B$17,$C$4,1,2)
    FindNth(range of data,value to lookup,1st instance,column)


    So to find many results
    =FindNth($A$4:$B$17,$C$4,1,2)
    =FindNth($A$4:$B$17,$C$4,2,2)
    =FindNth($A$4:$B$17,$C$4,3,2)
    =FindNth($A$4:$B$17,$C$4,4,2)
    =FindNth($A$4:$B$17,$C$4,5,2)

  3. #3
    Registered User
    Join Date
    08-01-2007
    Posts
    15
    Thanks Dave.

    Works great

    The only thing of minor concearn (if I understand this correctly) is that a maximum number of matches has to be predetermined.
    Please Login or Register  to view this content.
    So, if I figure that the worst case scenario will have maybe 10 entries for the same item, I cover 20 instances to be safe. Now, on some hot august day in hell, there happens to be 21

    Did I understand it correctly?

    I was also looking at the sumproduct function but I had trouble wrapping my head around it.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Looks a little overcomplicated to me - just use SUMIF

    =SUMIF(IMPORT!$A$2:$A$200,$B2,IMPORT!$H$2:$H$200)

  5. #5
    Registered User
    Join Date
    08-01-2007
    Posts
    15
    Thanks for the input

    That is what i had originally done but I had it separate on the import sheet.

    I was looking for a way to incorporate it in my vlookup on the static inventory sheet because the import sheet gets overwritten.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    The SUMIF formula I posted should go on the inventory sheet, doesn't that do what you want?

  7. #7
    Registered User
    Join Date
    08-01-2007
    Posts
    15
    Sorry, I wasnt paying attention ...duh

    I got going down a path and couldn't see the forest for the trees.

    Thanks for the help(and the additional smack on the head I needed)

+ 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