+ Reply to Thread
Results 1 to 4 of 4

How many of each part number was sold?

  1. #1
    Registered User
    Join Date
    02-21-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    1

    How many of each part number was sold?

    So here's the problem. I have a list of sales from last year. I need to find out how many of each part number was sold. The first column has part numbers, second has quantity. The part numbers may appear once, they may appear in 100 lines. There are 18000 lines or so total. How in the world do I do this?

    Example:

    Model # Qty
    19A4GLTEFU 13
    19A4GLTEFU 3
    19A4GLTEFU 1
    19A4GLTEFU 2
    19A4GLTEFU 1
    19GOBI2FU2 10
    19GOBI2FU2 20
    19GOBI2000FU 6
    19GOBI2000FU 1
    19GOBI2FU2 1
    19GOBI2FU2 5
    19GOBI2FU2 1
    19GOBI2FU2 5
    19GOBI2FU2 1
    19GOBI2FU2 1
    19GOBI2000FU 1
    19GOBI2FU2 6
    19GOBI2000FU 2
    19GOBI2FU2 3
    19GOBI2FU2 1
    19GOBI2FU2 43
    19GOBI2FU2 2
    19GOBI2000FU 2
    19GOBI2000FU 3
    19GOBI2000FU 3
    19GOBI2000FU 1

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,420

    Re: How many of each part number was sold?

    You can put this array* formula in D2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Adjust the ranges to suit your data (might be a bit slow with 18000 rows) then copy down as far as you think you need it. This will generate a list of unique items from column A.

    *NOTE that an array formula needs to be committed using the key combination of Ctrl-Shift-Enter (CSE) instead of the usual <Enter>.

    Then you can put this formula in E2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    then copy that down, to get the totals for each unique item.

    The attached file demonstrates this on your sample data.

    Hope this helps.

    Pete
    Attached Files Attached Files

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

    Re: How many of each part number was sold?

    Excel 2007 has a function that will remove duplicates.
    This is found under the Data ribbon.

    Copy the entire column to another column,select the new column and goto Data=>remove Duplicates.
    All duplicate items will be removed.
    Then you can use the sumif() formula to add the items.
    =SUMIF(A:A,H2,B:B)

    Checkout the simple example workbook. It is a macro enabled workbook, you will have to allow editing and whatever it asks you when you open the workbook.
    Click the button to get the results.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How many of each part number was sold?

    Ok

    Try The Following

    open the file

    look at the data

    press the button.

    if you want to see how it works then

    select developer at the top of excel

    select the macto and select step into

    minimise the visual basic window so you can see both it and the excel data


    pressing f8 will step you through the macro.

    Enjoy
    Attached Files Attached Files

+ 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