+ Reply to Thread
Results 1 to 4 of 4

Returning A Sum From Multiple Occurences

  1. #1
    Registered User
    Join Date
    07-22-2013
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    8

    Returning A Sum From Multiple Occurences

    I am trying to sum the total number of a certain part used on different jobs. The worksheet is set up as follows:

    Assembly #1 # for Job #1 # for Job #2 # for Job #3
    Part #2 2 3 5
    Part #4 1 1 1
    Part #8 3 2 1
    Part #10 6 4 2
    Part #15 5 1 3

    Assembly #2
    Part #2 2 2 2
    Part #4 1 2 3
    Part #6 5 1 8
    Part #7 6 8 7

    Then I would filter the parts to determine the unique parts. In this case I would create a list like the one below:

    Part #2
    Part #4
    Part #6
    Part #7
    Part #8
    Part #10
    Part #15

    At this point I need something that will take each unique part from this list and then come up with the total number of each part (adding all three jobs together).

    I was imaging something with an if statement that if analyzed the range of assemblies (which could be 100 different assemblies) and determined the total number of parts across all the jobs (but only for unique entries) which would require it to sum multiple lines. I just can't for the life of me come up with code that would do this.

    Thanks for any help.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Returning A Sum From Multiple Occurences

    Hello cdwelch4,

    The attached workbook has the macro below. A button on the worksheet runs the macro. The output list of part numbers and their required totals appears in column "J:K" on the same sheet.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    07-22-2013
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: Returning A Sum From Multiple Occurences

    That is great. Thank you so much. Is there a way to show two columns before the "Total Req'd" column that show the total for each job? To where it shows the total for Job #1, total for Job #2 and then the "Total Req'd" for all jobs.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Returning A Sum From Multiple Occurences

    Hello cdwelch4,

    This macro is a augmented version of the previous one. This list the Part Number, Jobs, Job counts, and the Total for each job starting in column "J". The output list is now sorted from smallest to largest part number.

    Here is the improved code...
    Please Login or Register  to view this content.
    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)

Similar Threads

  1. Find Multiple Occurences from Multiple Sources
    By erome in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-24-2012, 01:16 PM
  2. Finding Occurences of "True" and returning the Correlating Description
    By braydon16 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-23-2011, 03:56 PM
  3. returning count of unique occurences of a string from a range.
    By tinkerbelle in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-10-2011, 04:50 PM
  4. Replies: 3
    Last Post: 08-11-2010, 11:42 AM
  5. Replies: 2
    Last Post: 06-23-2009, 05:38 PM

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