+ Reply to Thread
Results 1 to 34 of 34

Sum Duplicates and remove - add price/cost/stock

  1. #1
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Sum Duplicates and remove - add price/cost/stock

    Hi Folks,

    I need some help

    The mfg provides us with a usage list for parts on machines, I need to tally the qty for each part, remove the duplicates and add the price/discount/stock data from another database.

    First the usage list;

    A,B,C,D are to be ignored

    E=Item F=Description G=qty

    I need to check if E is duplicated, if so then add qty's from G

    after this I need the duplicate items (E) removed.

    Example Before
    E F G
    002-1511-92 CAP 5
    002-1511-92 CAP 5

    Example After
    E F G
    002-1511-92 CAP 10

    Now the price list

    It's rather large so it's split into three sheets. 0-H , H-Q, Q-Z ( sorted by part number)

    A = item B=Description C= Price D=Discount E=Available Stock F=ignored

    If E from the usage list matches A from the price list then I need to harvest C,D,E and send to the usage list for the appropriate item. ( add columns to usage list with C,D,E data )

    Hopefully someone can help!! This would be a very useful script!
    Last edited by tada; 05-03-2010 at 11:27 AM.

  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,259

    Re: Sum Duplicates and remove - add price/cost/stock

    Hello tada,

    Welcome to the Forum!

    You mention there are two sheets, DSSS1 and DSSS2. Is one of these the price list? Will the results be saved to a new worksheet or somewhere else?
    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
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    Quote Originally Posted by Leith Ross View Post
    Hello tada,

    Welcome to the Forum!

    You mention there are two sheets, DSSS1 and DSSS2. Is one of these the price list? Will the results be saved to a new worksheet or somewhere else?
    I stand corrected, the DSSS-test.xls is made of 3 sheets, 0-H , H-Q, Q-Z ( sorted by part number)

  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,259

    Re: Sum Duplicates and remove - add price/cost/stock

    Hello tada,

    Glad you caught that error, but you didn't answer my question. It would be best for you to post the workbook for review.

  5. #5
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    Quote Originally Posted by Leith Ross View Post
    Hello tada,

    Glad you caught that error, but you didn't answer my question. It would be best for you to post the workbook for review.
    Ok, I guess I didn't understand your question then. I did add some more data to the original post, perhaps the answer is there.

    I'll post a sample of each file, that should help a ton.

    I would like to do this with two scrips , one for totaling up the part number qty's and removing the duplicate lines, and one for taking the data from the price list.

    here is the DSSS
    http://dl.dropbox.com/u/3155296/DSSS-test.xls

    here is a sample usage list
    http://dl.dropbox.com/u/3155296/usage-example.xls

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    One of the macros on my website is designed for this very thing, for the first part of your question.

    Columns to Rows - Consolidation Macros - See Part 4

    There's a sample file and the code you can tweak for your project to the correct columns.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  7. #7
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    Quote Originally Posted by JBeaucaire View Post
    One of the macros on my website is designed for this very thing, for the first part of your question.

    Columns to Rows - Consolidation Macros - See Part 4

    There's a sample file and the code you can tweak for your project to the correct columns.
    Great!

    I changed the code for the fields I need checked and it did the trick - now I just need to pull the price/cost/stock data from our master excel list and populate this information to the cleaned up usage sheet.

    Any ideas?

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    Glad that code worked for you, eat all you want there, lots of useful merge/parse functions, I use them all.

    I would expect an INDEX/MATCH() formula or a VLOOKUP() will work for your pricing issue. Both formulas work across workbooks, even if the 2nd wb is closed, which is nice. Read up on VLOOKUP, probably the simplest.

    Once you get your formulas in the right place and working, it's pretty easy to convert "adding the formulas" into VBA code, if that's still necessary.

  9. #9
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    Quote Originally Posted by JBeaucaire View Post
    Glad that code worked for you, eat all you want there, lots of useful merge/parse functions, I use them all.

    I would expect an INDEX/MATCH() formula or a VLOOKUP() will work for your pricing issue. Both formulas work across workbooks, even if the 2nd wb is closed, which is nice. Read up on VLOOKUP, probably the simplest.

    Once you get your formulas in the right place and working, it's pretty easy to convert "adding the formulas" into VBA code, if that's still necessary.
    I might be in over my head at this point?

    Maybe an example would help me.

    If Value in Column "E" on worksheet 1 matches value in Column "A" on worksheet 2 , then pull value from "C", "D", and "E" on worksheet 2, and append to worksheet 1, under "H", "I", and "J" respectively.

    Can anyone code that?

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    A formula approach, something like this in H2 on Sheet1:

    =INDEX(Sheet2!C:C, MATCH($E2, Sheet2!$A:$A, 0))

    Copy that to the right two columns, then down as needed. You should know if you got a good match as soon as you enter the first formula in H2.

    You need to make sure the sheetnames are accurately noted in the formula.

  11. #11
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    Quote Originally Posted by JBeaucaire View Post
    A formula approach, something like this in H2 on Sheet1:

    =INDEX(Sheet2!C:C, MATCH($E2, Sheet2!$A:$A, 0))

    Copy that to the right two columns, then down as needed. You should know if you got a good match as soon as you enter the first formula in H2.

    You need to make sure the sheetnames are accurately noted in the formula.
    Thanks, will this work between different worksheet/files ?

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    Yes. Just complete the reference while both workbooks are open.

    =INDEX([Data.xls]Sheet2!C:C, MATCH($E2, [Data.xls]Sheet2!$A:$A, 0))

    Then, when you close the source wb, the formula will expand itself to include the full path, so it will keep working. Try it, you'll see.

    NOTE: please consider NOT using the Quote button, you're duplicating my posts into yours for no gain, and it just clutters up your own thread. Use the Quick Reply button instead. The Quote is good for picking out something specific to discuss, but remove the rest.

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Sum Duplicates and remove - add price/cost/stock

    Quote Originally Posted by JBeaucaire View Post
    Good example, JB, your site is growing nicely.
    Entia non sunt multiplicanda sine necessitate

  14. #14
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    Thanks guys!

    I need to return a TRUE or FALSE value in my sheet.

    If the part number in Column A in sheet1 , matches Column J in sheet 5 then I need "TRUE" or "YES"

    Basically I want to check each part number against a list of machines bill of materials that is added in the work sheet as it's own sheet.

    Can this be done?

  15. #15
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    I must be doing this wrong

    Please Login or Register  to view this content.
    the file I want to check is DSSS.xls , I need to check 5 sheets on that file, they are named 1,2,3,4,5.

    If I find a match from column B on my master list, with Column A on DSSS then I need to pull the values from C,D,E from DSSS
    Last edited by tada; 05-04-2010 at 11:14 AM. Reason: clarification

  16. #16
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    Quote Originally Posted by tada View Post
    I need to return a TRUE or FALSE value in my sheet.

    If the part number in Column A in sheet1 , matches Column J in sheet 5 then I need "TRUE" or "YES"
    Working without a sample workbook...your question doesn't even make it clear which sheet you're wanting this formula on...so my guess would be this on Sheet1 for row 2:

    =ISNUMBER(MATCH(A2, Sheet5!J:J, 0))
    ...should give you a TRUE/FALSE answer...copy down.

  17. #17
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    Quote Originally Posted by JBeaucaire View Post

    =INDEX([Data.xls]Sheet2!C:C, MATCH($E2, [Data.xls]Sheet2!$A:$A, 0))
    How can I reference multiple sheets?

    =INDEX([DSSS.xls]Sheet2,Sheet3!C:C, MATCH($E2, [DSSS.xls]Sheet2,Sheet3!$A:$A, 0))

    ?

  18. #18
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    3D lookups are a tough one. I use a 3D VLOOKUP() technique, outlined completely on this page:
    There's a sample file and an explanation of the formulas.

  19. #19
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    Thanks for the link.. I'm lost already lol.

  20. #20
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    Yep, this one is a lot of work, typically.
    Last edited by JBeaucaire; 05-04-2010 at 02:37 PM.

  21. #21
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    I did managed to get a condensed item list, it's now in two sheets, instead of 5

  22. #22
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    Is it possible just to reference a xls file, and not the specific sheets?

  23. #23
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    Quote Originally Posted by tada View Post
    Is it possible just to reference a xls file, and not the specific sheets?
    No. Remote references must be complete.

  24. #24
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    Almost done!

    All I need to do now is populate the QTY needed per part.

    To do this I need to take part number in Column "B" , match to another sheet in Column "J" and return the QTY from Column "C"

    Any ideas?

  25. #25
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock


  26. #26
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    Put this in A4 and then copy down as far as needed.
    =IF(ISNUMBER(MATCH(B4,'110724'!J:J,0)), INDEX('110724'!B:B, MATCH(B4, '110724'!J:J, 0)), "")

  27. #27
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    you rock!
    thanks, trying now

  28. #28
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    ps any way to have it return the highest QTY it finds?

    I need enough on hand for the worst case repair situation.. it's finding a lot of 1's right now.. lol

  29. #29
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    Your question doesn't match the sample data you posted. Update with a better set of sample data and post again. Represent as much of the data as you can to show what you have to deal with, all the hurdles, and then your desired results.

  30. #30
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock


  31. #31
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    This is a whole new creature.

    Mark this thread as solved and post this up as a new question. You'll garner the attention of all the other contributors that look for new questions.

    You should be prepared to accept a VBA solution, too, I imagine formulas might work, but they would be very intense and a LOT of them would most like cause performance issues with your workbook.

    ========
    If your original need is resolved, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If the PREFIX box is no longer available, just add [SOLVED] to the start of the title.

  32. #32
    Registered User
    Join Date
    05-03-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Sum Duplicates and remove - add price/cost/stock

    ok, new thread up.

    VBA solution is find with me

    Not sure how to 'mark solved' on this one, sorry.

  33. #33
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Sum Duplicates and remove - add price/cost/stock

    Not sure how to 'mark solved' on this one, sorry.
    For that and a fount of other useful information, please see the forum rules.

  34. #34
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum Duplicates and remove - add price/cost/stock

    Quote Originally Posted by tada View Post
    Not sure how to 'mark solved' on this one, sorry.
    Really? Post #31 does seem to have two very specific instruction/suggestions for you.

+ 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