+ Reply to Thread
Results 1 to 8 of 8

comparing lists

  1. #1
    Registered User
    Join Date
    01-23-2018
    Location
    usa
    MS-Off Ver
    2016
    Posts
    4

    comparing lists

    Car Example
    There is a list of components used in the assembly of a car along with the quantity of each component used. The car got new snow tires and a different version of a drive shaft. So the component list changed and so did the quantity of certain components such as bolts. I am left with two lists. One that correlates to the old car and one that correlates to the new car.

    I want to be able to copy and paste the list of old components into a column, the list of old quantities right next to it and then do the same with the new list on the same excel sheet. I then want to copy this information to a different sheet which will then compare the two lists. I want to know what components were omitted and added along with changes to the quantity of a part used.

    Is this possible?

    Note:
    I have multiple cars and want to be able to do this with each car when each changes. So I want to be able to copy of the data from the first sheet to the second sheet only if there is a value in that box. So maybe have a loop start at a certain point in a column and cycle down the column until I don't have anymore values.

    I know it's a lot of information but I just need a little guidance. This is being used for a project at work that does not have anything to do with cars...just an example.

    Thank you

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: comparing lists

    can you attach a sample file with data organized the way would see it and create a tab with results [even if you enter results manually].
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: comparing lists

    Maybe if you could mock up an example workbook showing us what the "car" data looks like at the start and show us your expected output through each stage it may result in some useful guidance (or even a full solution) quicker than us guessing/creating something that needs to be adapted to suit.

    BSB

  4. #4
    Registered User
    Join Date
    01-23-2018
    Location
    usa
    MS-Off Ver
    2016
    Posts
    4

    Re: comparing lists

    Sheet 1: “Enter Old list of parts”
    This is where the user will paste the existing parts list. Accompanying the parts list is a “name of list” that is placed in the grey box. This is automatic and I cannot avoid having that included when I paste into excel. When pasting the new parts list, there is no “name of list” that accompanies the list. I have highlighted in different colors what the differences are between the two lists. Looking at the new list, 4 parts have been omitted, 2 parts have been added, and the quantity of two components have changed.

    Sheet 2: “Comparison”
    I have imported both lists so they start on the same row. In the “Changes” column I attempted to compare the two quantities in column A and D and then in columns B and E.

    Goal: I want an output box or something to tell me what parts were omitted, added, or any quantity changes that are recognized in the new list.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-23-2018
    Location
    usa
    MS-Off Ver
    2016
    Posts
    4

    Re: comparing lists

    Id also like to figure out a way for the program to only copy over data from the first sheet to the second only if there is a value in that box. I will be comparing lists of different lengths.

  6. #6
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: comparing lists

    Based on the example you provided, you have a list of old parts and a list of new parts. You want to compare these and come up with 3 lists:
    1. Items from the old list NOT on the new list (and their quantities)
    2. Items on the new list NOT on the old list (and their quantities)
    3. Items on both lists whose quantities have changed on the new list from the old (and their quantities)

    Is that a correct summation of what you want to accomplish? If so I dont see a need for VBA to do this unless there is more to it than has been explained or is in your sample. Ill see if I can come up with a way to do this if I am correct in my undertanding
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  7. #7
    Registered User
    Join Date
    01-23-2018
    Location
    usa
    MS-Off Ver
    2016
    Posts
    4

    Re: comparing lists

    Yes that is correct. I just want to see how the changes made to the old list that now creates the new list. omitted items, added, items and items that have a quantity change

  8. #8
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: comparing lists

    See attached. I created 5 new sheets (so that your old sheets are unchanged and you may easily compare results.

    I have a sheet for old items, new items and then a sheet for the omitted results, added results and qty changed results. Take note that you made a mistake in your original sample for qty changed as you listed 1 that didn't change and missed one that did. These formulas caught that.

    A couple helper columns makes this all possible. I set the old list and new list as tables to make them easier to reference. The results on the last 3 sheets have formulas filled down past the expected number of results to return so that changes will allow it to update dynamically.

    If you have questions let me know
    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. Comparing two lists
    By DG328 in forum Excel General
    Replies: 3
    Last Post: 07-30-2016, 12:38 AM
  2. Help comparing three lists
    By coachbobbyfinstock in forum Excel General
    Replies: 4
    Last Post: 07-09-2013, 01:22 PM
  3. Help with comparing lists
    By kufta4 in forum Excel General
    Replies: 3
    Last Post: 05-24-2012, 07:44 PM
  4. Comparing Lists
    By jcswim in forum Excel General
    Replies: 2
    Last Post: 05-23-2008, 03:22 PM
  5. [SOLVED] Comparing lists
    By John in MN in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-24-2006, 02:10 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