+ Reply to Thread
Results 1 to 7 of 7

unique records and summing quantites

  1. #1
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    unique records and summing quantites

    Hi All,

    I have got a problem with finding a formula to sort and sum products.

    Most of formulas I thoght of are only counting number of times it appears or comes back with the number of the unique records under one product.

    I have two columns
    In the first one I have product ID Numbers
    In the second column I have Product quantities.

    Ex.
    bmok1298 50
    cmsh4365 100

    bmok1298 75
    dngl3487 250

    What I was trying to do is sum the quantities of the unique records and avoid the blanks.

    So It should come back as:
    bmok1298 125
    cmsh4365 100
    dngl3487 250

    The worst thing is that I don't know what the product ID's will be as it will change every time.

    Is there any thing that can be done to achieve that.

    It would be 1 cell will be serching for the unique product ID's and listing them one under another, where the second cell will be summing all the figures referred to the record found by the first one.

    Or shall I try with some kind of macro?

    Thank you for reading it and cracking your head over it.

    Simon
    Last edited by Ramzes; 03-01-2010 at 11:41 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: unique records and summing quantites

    Try using Pivot Tables:

    http://peltiertech.com/Excel/Pivots/pivotstart.htm

    http://datapigtechnologies.com/ExcelMain.htm
    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
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: unique records and summing quantites

    Thank you for your help,

    I have created a pivot table and it worked as I wanted. But here I have found new problem. As this will be a template file I need that table to automatically get the data from the Sheet1.Can this be done with Automatic Calculation on so every time I change data in the datasource it will automatically update itself with the product ID and qty?

    Anyone who has any Idea please help.

    I am still doing my own research on it as I have never done a pivot table before so it is new to me.

    Thanks for reading it.

    I hope I explained it well

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

    Re: unique records and summing quantites


  5. #5
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: unique records and summing quantites

    Thanks Again NBVC,

    I have done that code and it did automatically update itself.
    Unfortunately only with the data that I was summing only. The product ID didn't go. The other problem twith it was - having your calculations on - workbook will never stop calculating. So can I assign a button to that VBA code like we do to macros? And make it update itself only by pressing a button.

    I also need the first field to update itself (product ID's).

    I'm trying and I'm trying and still in the same position.

    I attach a file if it can help.

    Please turn off your automatic calculation before opening the file (otherwise you will need to use the manager to close it).

    Thanks for reading
    Simon
    Attached Files Attached Files

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

    Re: unique records and summing quantites

    I am not sure what you mean...

    I did not have calculation problems.. I see no formulas and your Pivot Table is okay...

    You can hide the (blanks) row, by right-clicking there are choosing hide.

    I added new Customer Part ID's and Shipped Quantities... and when I refresh the table they got added to the list....

    To make the refresh on a button, remove the code you added for refreshing and instead add a new module to the editor window with code:

    Please Login or Register  to view this content.
    Then add a button to your sheet (go to View|Toolbars and select Forms to see the toolbar, select and drag the button icon onto your sheet, then assign the macro above to it....

  7. #7
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: unique records and summing quantites

    Thank you for your help.

    It runs perfectly.

    Once again - thank you.
    Simon

+ 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