+ Reply to Thread
Results 1 to 11 of 11

qty from multiple orders to fill multiple requests over different dates

  1. #1
    Registered User
    Join Date
    10-01-2020
    Location
    London, England
    MS-Off Ver
    365
    Posts
    78

    qty from multiple orders to fill multiple requests over different dates

    Hi community,

    I really don't know how to explain this concisely.

    I have a list of order numbers, items on that order and the quantities still to be delivered.

    I receive a request for a certain number of items to be delivered on a specific date.
    This is usually, X next week, Y week after, Z week after.
    The customer wants to know which order numbers the items being delivered are from and which date.

    Ideally from my end, I need to use up the orders that are the oldest.

    What I need to automate, is the back filling from the oldest orders and how many items from that order number are being delivered.

    Hopefully the example will aid in describing.

    A-C are the outstanding orders
    E-G tracking quantities, not functional
    I-M the requested dates and quantities of items
    P-T Ideal output with shade colours for the first date to aid with visuals
    Red / Grey colour, highlighting the order numbers used
    Green / Blue, the quantities of each
    Yellow, just showing the date to match request / order

    Where orders don't fully cover the request, the remaining will be made up from the next order number.
    E.G. As shown in cell R7 & 8. 10 are needed. 5 available from order 503 and 5 from order 500, with 2 remaining.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: qty from multiple orders to fill multiple requests over different dates

    This proposal is a combination of Power Query and formulas.
    1. Rearrange the data in at the top of the sheet and automate the "Just so I can keep track" part using: =MIN($C23-SUM($D23:D23),INDEX(E$20:E$21,MATCH($B23,$D$20:$D$21,0))-SUMIFS(E$22:E22,$B$22:$B22,$B23))
    2. Rearrange the "Customers requests for quantities and delivery date" part using the following Power Query Advanced Editor code:
    Please Login or Register  to view this content.
    3. Populate a column to count rows per item per date using: =SUMPRODUCT((B$23:B$28=I20)*(E$18:G$18=J20+0)*(E$23:G$28>0))
    4. Populate a column to display cumulative rows using: =SUM(M19,L20)
    5. Populate the Item and Delivery Date columns using similar formulas:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    6. Populate the Quantity column using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    7. Populate the Order Number column using: =IF(Q19="","",INDEX(A$23:A$28,AGGREGATE(15,6,(ROW(A$23:A$28)-ROW(A$22))/(INDEX(E$23:G$28,,MATCH(S19,E$18:G$18))>0),COUNTIFS(S$19:S19,S19))))
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,827

    Re: qty from multiple orders to fill multiple requests over different dates

    Question - is the higher the order number the older the order? I would have thought the other way around, but you fulfill item 755A with 5 from each order (500 and 503) when there are 7 from 500? So is 503 the older order number? You seem to be filling the orders in the opposite way I'd expect so I'm assuming the higher the order # the older the order (which doesn't normally make sense).

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: qty from multiple orders to fill multiple requests over different dates

    Macro solution is ok?
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    10-01-2020
    Location
    London, England
    MS-Off Ver
    365
    Posts
    78

    Re: qty from multiple orders to fill multiple requests over different dates

    Hi JeteMc,

    Thanks for the time and effort you have put into this.
    Looks like it does exactly as required!
    I'll spend some time going through and try to understand each step you have laid out and come back with more praise, or questions if I can't figure it out.

  6. #6
    Registered User
    Join Date
    10-01-2020
    Location
    London, England
    MS-Off Ver
    365
    Posts
    78

    Re: qty from multiple orders to fill multiple requests over different dates

    Hi Gregb11,

    Sharp eyes, indeed you are correct. Higher numbers = younger order.
    I didn't order that part properly when putting the sample data together. The proper order numbers are 9 digits long, but I felt that was superfluous for this example.

  7. #7
    Registered User
    Join Date
    10-01-2020
    Location
    London, England
    MS-Off Ver
    365
    Posts
    78

    Re: qty from multiple orders to fill multiple requests over different dates

    Hi kvsrinivasamurthy,

    Macro is absolutely fine. It is staying local to me, so I am happy with a solution that works in which every way imaginable.
    It's all a learning curve!

  8. #8
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: qty from multiple orders to fill multiple requests over different dates

    Pure macro solution -

    Please Login or Register  to view this content.
    You need to specify outstanding orders (A-C) in sheet 'Orders' and delivery requests (I-M) in sheet 'Delivery'. The output will be generated in sheet "Output'.
    Note that orders will be fulfilled in whatever order they exist on the 'Orders' sheet and not as per their order numbers. If you need to fulfill them as per their order numbers you can accordingly sort the data before running the macro.

    Sample attached.
    Attached Files Attached Files
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: qty from multiple orders to fill multiple requests over different dates

    Macro code
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-01-2020
    Location
    London, England
    MS-Off Ver
    365
    Posts
    78

    Re: qty from multiple orders to fill multiple requests over different dates

    Thankyou to all solutions. I am now able to process the data as needed.

  11. #11
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: qty from multiple orders to fill multiple requests over different dates

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Auto-Fill Dates Across Multiple Worksheets
    By BanzaiGuy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-31-2019, 12:14 PM
  2. [SOLVED] Multiple Worksheet_Change requests - Unable to get requests working simultaneously
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2017, 12:39 PM
  3. [SOLVED] VLookup with multiple orders
    By AMSBenji in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2013, 05:35 PM
  4. [SOLVED] Multiple Orders per Client
    By Aurayai in forum Excel General
    Replies: 2
    Last Post: 06-07-2012, 10:34 AM
  5. Fill in multiple cells driven by dates entered
    By liam_bettinson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2011, 06:59 PM
  6. Replies: 1
    Last Post: 09-06-2011, 07:05 PM
  7. Calculate orders that went out same day from multiple sheets
    By Apel in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-21-2009, 04:14 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