+ Reply to Thread
Results 1 to 13 of 13

Need Help with Index, Match, Match with multiple results and copying data x times

  1. #1
    Registered User
    Join Date
    05-23-2019
    Location
    So Cal
    MS-Off Ver
    Office 365
    Posts
    9

    Need Help with Index, Match, Match with multiple results and copying data x times

    Hey y'all,

    I have a problem that I have been working too hard on. Please provide some guidance.

    On Worksheet 1, has up to 1,000 rows, data starting at Row 4 with the following columns: (This worksheet has one row for each unique entry of Destination, Trucking Company, And Date 1)
    ws1 A - Destination (text)
    ws1 B - Trucking Company (text)
    ws1 C - Projected Containers by Date and Trucking Company (This is a number derived from Solver LINKED DATA) (integer)
    ws1 D - Date 1 (date mm/dd/yyyy) LINKED DATA
    ws1 E - Date 2(date mm/dd/yyyy) FORMULA

    On Worksheet 2, has up to 10,000 rows, data starting at row 13. I have the following columns: (This worksheet has one row for each unique entry of Destination, Container ID and Date 1)
    ws2 A - Destination (Text) (Names match Column A on Worksheet 1)
    ws2 B - Date 1 (date mm/dd/yyyy)(Date matches Column D on Worksheet 1)
    ws2 C - Priority (Integer)
    ws2 D - Container ID (The count of the Containers matches Column C above, but has the detail of each container on separate rows)
    ws2 E - Status (Text LINKED)
    ws2 F - Date 2 (date mm/dd/yyyy FORMULA)(Date matches Column E on Worksheet 1)
    ws2 G - Assigned Trucking Company (text) ----> This is the big problem.

    Here is what I can not figure out. How do I match ws1A to ws2A and then if there is a match (which there will be many), match up ws1D and ws2B. (Destination to Destination, Date1 to Date1). (Once the match(s) is found, the count of these will match WS1 for each Date/Destination combo.) So, how do I take the information in ws1C and copy that data into ws2G?

    I am at a loss. It is a huge file, with tons of other data, so I can send screen shots, if helpful. Please, I have tried several methods and I feel like giving up.
    Attached Files Attached Files
    Last edited by jrboyd; 05-23-2019 at 11:26 AM. Reason: Adding File

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    It's hard to work with a screenshot. Can you attach a copy of your file, de-sensitized if necessary?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    05-23-2019
    Location
    So Cal
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    Thank you so much, Mumps1! I uploaded the file with just the two worksheets and "sanitized" information! I would have sent my "attempt" at the code, but frankly, it was just darn embarrassing at how frustrated and convoluted I was getting

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    In WS1 there are 13 occurrences of ACTF with an Expected Ready Date of 5/20/2019. In WS2 there are 5 occurrences of ACTF with an Vessel ETA Dte of 5/20/2019. Can you please explain in detail how the following statement
    Once the match(s) is found, the count of these will match WS1 for each Date/Destination combo.) So, how do I take the information in ws1C and copy that data into ws2G?
    is related to my example? In other words, now that the matches are found, what would be the expected result in ws2G? Please refer to specific cells, rows, columns and sheets.

  5. #5
    Registered User
    Join Date
    05-23-2019
    Location
    So Cal
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    First Off, Thank you so very much for your attention to this little challenge. It literally kept me up all night trying to come up with a solution. Let explain a bit further. On ws1, If you look just at Dest Warehouse ACTF and Expected Ready Date of 5/20/2019, there are 13 rows, as follows: I used filter to select vendor and date for my examples

    Dest Warehouse Best Vendor Projected Containers Expected Ready Date Vessel ETA Dte
    ACTF CONJU 0 5/20/2019 5/15/2019
    ACTF DA 0 5/20/2019 5/15/2019
    ACTF GFS 0 5/20/2019 5/15/2019
    ACTF GCJD 0 5/20/2019 5/15/2019
    ACTF GS 0 5/20/2019 5/15/2019
    ACTF LSE 0 5/20/2019 5/15/2019
    ACTF MF 0 5/20/2019 5/15/2019
    ACTF MYR 0 5/20/2019 5/15/2019
    ACTF NFS 0 5/20/2019 5/15/2019
    ACTF NTG 0 5/20/2019 5/15/2019
    ACTF PCF 2 5/20/2019 5/15/2019 <---------- This Vendor(PCF) has two trucks available to go to this destination on this day.
    ACTF PXG 0 5/20/2019 5/15/2019
    ACTF TI 0 5/20/2019 5/15/2019

    If you look at ws2, Dest Warehouse = ACTF and PickupDate = 5/20/19, there are two rows indicating that there are two containers that will be ready for pickup, as follows:
    Dest Warehouse Best Vendor Projected Containers Expected Ready Date Vessel ETA Dte

    Dest Warehouse Vessel ETA Dte Priority Container ID# Status Pickup Date VENDOR ASSIGNMENT
    ACTF 5/15/2019 4 7014876 Not Available 5/20/2019
    ACTF 5/15/2019 3 6811681 Not Available 5/20/2019

    What I would like to do is put the vendor code in the Vendor Assignment column.

    Now, sometimes, there are containers ready to ship, but no vendor trucks available. In this case, Vendor Assignment can remain blank.

    Other times, there may be more than one vendor available for the containers, as follows:

    ws1
    Dest Warehouse Best Vendor Projected Containers Expected Ready Date Vessel ETA Dte
    PTC2 CONJU 0 5/24/2019 5/19/2019
    PTC2 DA 0 5/24/2019 5/19/2019
    PTC2 GFS 0 5/24/2019 5/19/2019
    PTC2 GCJD 0 5/24/2019 5/19/2019
    PTC2 GS 12 5/24/2019 5/19/2019 So, here we have 3 vendors that can handle 22 total containers
    PTC2 LSE 8 5/24/2019 5/19/2019
    PTC2 MF 0 5/24/2019 5/19/2019
    PTC2 MYR 0 5/24/2019 5/19/2019
    PTC2 NFS 0 5/24/2019 5/19/2019
    PTC2 NTG 0 5/24/2019 5/19/2019
    PTC2 PCF 2 5/24/2019 5/19/2019
    PTC2 PXG 0 5/24/2019 5/19/2019
    PTC2 TI 0 5/24/2019 5/19/2019

    ws2:
    Dest Warehouse Vessel ETA Dte Priority Container ID# Status Pickup Date VENDOR ASSIGNMENT
    PTC2 5/19/2019 3 8395544 Not Available 5/24/2019
    PTC2 5/19/2019 3 9694821 Not Available 5/24/2019
    PTC2 5/19/2019 3 6827141 Not Available 5/24/2019
    PTC2 5/19/2019 3 8430773 Not Available 5/24/2019
    PTC2 5/19/2019 3 4979719 Not Available 5/24/2019
    PTC2 5/19/2019 3 6815265 Not Available 5/24/2019
    PTC2 5/19/2019 3 7844281 Not Available 5/24/2019
    PTC2 5/19/2019 3 8104976 Not Available 5/24/2019 And here we have 22 total containers
    PTC2 5/19/2019 3 9586742 Not Available 5/24/2019
    PTC2 5/19/2019 3 3183749 Not Available 5/24/2019
    PTC2 5/19/2019 3 2530352 Not Available 5/24/2019
    PTC2 5/19/2019 3 5446412 Not Available 5/24/2019
    PTC2 5/19/2019 3 8034765 Not Available 5/24/2019
    PTC2 5/19/2019 3 1154503 Not Available 5/24/2019
    PTC2 5/19/2019 3 6770545 Not Available 5/24/2019
    PTC2 5/19/2019 3 1588995 Not Available 5/24/2019
    PTC2 5/19/2019 3 3806203 Not Available 5/24/2019
    PTC2 5/19/2019 3 7809199 Not Available 5/24/2019
    PTC2 5/19/2019 3 6637069 Not Available 5/24/2019
    PTC2 5/19/2019 3 5867987 Not Available 5/24/2019
    PTC2 5/19/2019 3 9809261 Not Available 5/24/2019
    PTC2 5/19/2019 3 2698256 Not Available 5/24/2019


    In this case, I need to assign all 24 vendors to all 24 containers and it doesn't really matter which vendor gets which container.

    Basically, I took all the information from ws2 to determine the number of containers needed to be delivered to each destination warehouse by each day (that we had data on). Then, I used solver to determine the most cost effective vendor match for each day, since each vendor has a different price for east dest warehouse. Right now, I have the data in solver for ACTF, FTCI, PL17, PLC1, PSSVCCI, PTC2 and PTC3, so that is what is on ws1. I used these because they typically have the largest volume.

    I had to loop solver through each day, because of the 200 variable limitation. And, I have to ultimately forecast out 30-60 days at times.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    Please give me a little time to get my head around this.

  7. #7
    Registered User
    Join Date
    05-23-2019
    Location
    So Cal
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    Thank so much! Would it be easier if I added a column where date1 and dest warehouse were combined on each sheet? So it would be matching one column with unique cells to one column with duplicate cells? The grabbing the vendor from ws1 and adding it to the match in Washington 2? x times, then next? I really hate to give up on things, I am a Taurus! Lol

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    I'm working on something now but if you attach a revised copy of your file with date1 and dest warehouse combined on each sheet, I can see if that works better.

  9. #9
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    This macro seems to work as long as the number of containers ready to ship matches the number of vendor trucks available. Give it a try and we'll go from there.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    05-23-2019
    Location
    So Cal
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    You are a miracle worker! I uploaded a file with the reference of Dest Warehouse/Date for each worksheet. It is call Excel test Revision 1 !!! Would it be too early to say I LOVE YOU!!!!! You are so awesome!
    Attached Files Attached Files

  11. #11
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    You are very welcome and thank you for the kind words. Please use the version below. I just tweaked it to remove the autofilter in ws2 and to accommodate for a changing number of warehouses.
    Please Login or Register  to view this content.
    Last edited by Mumps1; 05-25-2019 at 08:21 AM.

  12. #12
    Registered User
    Join Date
    05-23-2019
    Location
    So Cal
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    I seriously can not thank you enough! Your work helped me create a workbook that imports container data for over 5,000 containers consisting with more than 25 destinations, then uses solver to find the most cost efficient combination of carriers and estimates the cost per day by destination and then assigns the shipping company to each container. My dashboard allows the end user to select dates they want to see coverage of, and projects 60 days in advance. I have graphs, cost forecasts and shipping budgets. This is a tremendous improvement over the current process! I could not have finished this project without you! I am immensely happy with the outcome and I credit you with putting the icing on the cake! You are amazing!

  13. #13
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Need Help with Index, Match, Match with multiple results and copying data x times

    It was my pleasure and I'm very glad that everything has worked out for you.

+ 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. VBA index Match, multiple RESULTS, Not a UDF
    By atdemeo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2017, 12:57 PM
  2. [SOLVED] Index / Match - match 3 input values and return the results from the index
    By t83357 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2016, 07:34 PM
  3. Multiple results Index Match
    By vortexx in forum Excel General
    Replies: 4
    Last Post: 05-09-2016, 03:51 AM
  4. [SOLVED] Index, Match, Multiple Results
    By ecorf in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-28-2013, 11:37 AM
  5. Using Index Match to return multiple results with very messy data.
    By falkon007 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-30-2013, 12:28 PM
  6. Index/Match with multiple results
    By kwadjo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-26-2013, 04:05 PM
  7. Index and Match and multiple results
    By mike2bf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-06-2008, 04:10 PM

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