+ Reply to Thread
Results 1 to 5 of 5

VLOOKUP to find sum of all duplicates

Hybrid View

  1. #1
    Registered User
    Join Date
    07-11-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    20

    Question VLOOKUP to find sum of all duplicates

    Hello,

    I am trying to extract the sum of all numbers (QTY) for the same lookup_value.

    PART# LOCATION QTY
    ABC LA 0
    ABC TX 5
    ABC NY 6
    ZXC LA 1
    ZXC TX 5
    ZXC NY 9

    So I want to have, ABC showing "11" (0+5+6), and ZXC=15

    Also, how do I use vlookup with a condition (IF maybe?), to do a vlookup for ABC on QTY when it is LA, for QTY when it is TX, for QTY when it is NY separately?

    Thank you!

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: VLOOKUP to find sum of all duplicates

    For question #1

    In F1 place ABC, then use >> =SUMIF(A2:A7,F1,C2:C7)

    For question #2
    With ABC in F1 and LA in G1 >> =SUMIFS(C2:C7,A2:A7,F1,B2:B7,G1)
    HTH
    Regards, Jeff

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: VLOOKUP to find sum of all duplicates

    Also, don't forget about a pivot table which can summarize all in one go...

  4. #4
    Registered User
    Join Date
    07-11-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    20

    Re: VLOOKUP to find sum of all duplicates

    Thank you Jeffrey for your prompt response.

    SUMIF/SUMIFS works great.

    I thought about the pivot table; I need to extract some data like quantity, vendor, buyer, application from each part number onto another worksheet. The problem I have is that I have 13 worksheets, and each of them have 45k rows and 55 columns.

    Each worksheet represents a month (the end of it), so I was thinking maybe I can record a macro of me doing a pivot table on worksheet"month1" and applying it to all the worksheets.. OR

    I can put all worksheets together vertically or horizontally, and add a column/row for MONTH, and then do a pivot table that will slice through it. The other problem I will have however is that, I need two worksheets for one count of data-> Each worksheet represents values for the end of the month, so for me to find the average quantity of inventory held, I need to ADD quantity (Available) from end of month1, to quantity available from end of month2, and then divide by 2 to get somewhat my "Average" quantity of inventory for month2.

    Sorry if I went on a tangent here-, maybe ill just do pivots for each worksheet and then do vlookup from pivot tables so I can calculate my average per month. Anything I do, needs to be recordable on macros, so I can apply it next month when a new end of month worksheet comes out.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: VLOOKUP to find sum of all duplicates

    My opinion would be to consolidate all the months on one worksheet (as you suggest) which would make the pivoting through data much easier.

    As far as a macor for the pivot table, I'm not all that familiar with pivot table macros, but sure there are many web resources which can help.

    Seems the first step should be consolidating your datat and then we can take it from there...

+ 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. Macro to find duplicates, concatenate cells, then delete old duplicates
    By givemepuppies in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-04-2016, 02:43 AM
  2. [SOLVED] Macro to find duplicates, concatenate Unique Values, then delete old duplicates
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-17-2013, 04:32 PM
  3. [SOLVED] Find duplicates, concatenate into different column, sum and delete duplicates
    By rosannang in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-17-2013, 11:23 AM
  4. Replies: 5
    Last Post: 02-28-2012, 02:52 PM
  5. Replies: 1
    Last Post: 07-13-2010, 10:09 AM

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