Forum Discussion

JimDW2450's avatar
JimDW2450
Copper Contributor
Mar 30, 2020
Solved

Count Numbers and Quantities

I have Column A that has multiple duplicate part numbers Column B shows a QTY for that part number

 

I want to remove duplicates but count the quantities, so for example

 

Part Number     QTY

A                          B

123                       3

123                       3

456                        5

456                       2

 

 

Result 

 

Part Number            Total QTY

123                                6

456                                7

 

Can anyone tell me how to do that?

  • JimDW2450

    In my example below, you can see that I am currently in cell A1. Hence, in my Create PivotTable box, the cell reference is visible.. 

     

     

10 Replies

  • JimDW2450 

    The difficult part is to get a list on distinct part numbers.

     

    In traditional Excel that can be most easily done manually. Formulas involving MATCH, SMALL and INDEX are possible, but laborious.  In the most recent versions of Office365, the formula is

    = UNIQUE( Parts[Number] )

    where I have assumed the basic data is held in a Table named 'Parts'; 

    [requires Office2007 or later].

     

    Either way the count is returned using SUMIFS

    = SUMIFS( Parts[QTY], Parts[Number], distinctPart )

  • JimDW2450

    In my example below, you can see that I am currently in cell A1. Hence, in my Create PivotTable box, the cell reference is visible.. 

     

     

    • JimDW2450's avatar
      JimDW2450
      Copper Contributor

      Abiola1 

       

      I have never used a pivot table can you point me to the right direction on a how to?

      • Abiola1's avatar
        Abiola1
        MVP

        JimDW2450 

         

        To use the PivotTable:

        1. Click inside the data

        2. In the Insert tab, on the far left, click on PivotTable

        3. In the PivotTable dialogue box, click on OK

        In the PivotTable Fields, drag and drop Part Number inside Rows and Qty inside Values

         

        That is all

         

        If this answers your question, kindly accept as Best Response 

Resources