BrutalDawg
New Member
- Joined
- Jun 10, 2015
- Messages
- 41
I have spent the last few hours trying to find something similar to the issue I am having and currently have smoke coming out of my ears!
I have two sheets, one with orders the second with sales.
I need help automatically subtracting from orders based on sales.
I am trying to develop a script that would run through every sale and if location and item are exactly the same, subtract quantity sold from the quantity ordered to give a "new due" quantity.
There will be sales with no order which is a non issue, but would be nice if those results could go to a different tab. Below is a summary of what is required in n00b terms.
<code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet1</code> is sold, <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet2</code> is order.
If <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet1</code> C2 & F2 are same as any row in <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet2</code> (A2,D2 are correlating fields) subtract <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet1</code>G2, from <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet2</code> F2.
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5698[/TD]
[TD="align: right"]60[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5693[/TD]
[TD="align: right"]50[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]1/24/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5701[/TD]
[TD="align: right"]220[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5699[/TD]
[TD="align: right"]112[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]1/26/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5729[/TD]
[TD="align: right"]20[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5693[/TD]
[TD="align: right"]205[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5695[/TD]
[TD="align: right"]165[/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5698[/TD]
[TD="align: right"]45[/TD]
</tbody>
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]28[/TD]
[TD="align: right"]1/23/2017[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]1/23/2017[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]174[/TD]
[TD="align: right"]1/23/2017[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]205[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]110[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]10[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]60[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]11[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]12[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]13[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]164[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]14[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]15[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]204[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]16[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]17[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]188[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]18[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]60[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]19[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]299[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]20[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]21[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]197[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]22[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]2/13/2017[/TD]
[TD="align: center"]23[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]166[/TD]
[TD="align: right"]2/13/2017[/TD]
[TD="align: center"]24[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2/13/2017[/TD]
</tbody>
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: center"]2[/TD]
[TD="bgcolor: #FFFF00"]TEXAS[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1843[/TD]
[TD="bgcolor: #FFFF00"]Immediate:Discrete[/TD]
[TD="bgcolor: #C6EFCE, align: right"]-299[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="align: right"]0[/TD]
[TD="align: center"]3[/TD]
[TD="bgcolor: #FFFF00"]Oklahoma[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1852[/TD]
[TD="bgcolor: #FFFF00"]Firm:Weekly Bucket (Monday through Sunday)[/TD]
[TD="bgcolor: #C6EFCE, align: right"]-177[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/23/2017[/TD]
[TD="align: right"]0[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]1/23/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]174[/TD]
[TD="align: right"]1/23/2017[/TD]
[TD="align: right"]-45[/TD]
[TD="align: center"]6[/TD]
[TD="bgcolor: #FFFF00"]Oklahoma[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1882[/TD]
[TD="bgcolor: #FFFF00"]Firm:Weekly Bucket (Monday through Sunday)[/TD]
[TD="bgcolor: #C6EFCE, align: right"]-47[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/30/2017[/TD]
[TD="align: right"]0[/TD]
[TD="align: center"]7[/TD]
[TD="bgcolor: #FFFF00"]Oklahoma[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1852[/TD]
[TD="bgcolor: #FFFF00"]Firm:Weekly Bucket (Monday through Sunday)[/TD]
[TD="bgcolor: #FFFF00, align: right"]205[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/30/2017[/TD]
[TD="bgcolor: #FFC7CE, align: right"]28[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]110[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]10[/TD]
[TD="bgcolor: #FFFF00"]OHIO[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1874[/TD]
[TD="bgcolor: #FFFF00"]Firm:Weekly Bucket (Monday through Sunday)[/TD]
[TD="bgcolor: #C6EFCE, align: right"]0[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/30/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]11[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]-3[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: right"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]13[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]164[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]14[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]15[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]204[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]16[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]17[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]188[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]18[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]60[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]19[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]299[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"]296[/TD]
[TD="align: center"]20[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]21[/TD]
[TD="bgcolor: #FFFF00"]Mexico[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1852[/TD]
[TD="bgcolor: #FFFF00"]Firm:Weekly Bucket (Monday through Sunday)[/TD]
[TD="bgcolor: #FFC7CE, align: right"]32[/TD]
[TD="bgcolor: #FFFF00, align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]22[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]2/13/2017[/TD]
[TD="align: center"]23[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]166[/TD]
[TD="align: right"]2/13/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]24[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2/13/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]25[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]110[/TD]
[TD="align: right"]2/20/2017[/TD]
[TD="align: right"]65[/TD]
[TD="align: center"]26[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
On the results tab everything highlighted in yellow is what would have changed. Items not highlighted in yellow there was no sale. The green and red formatting was for reference and is not required if to difficult. (would be ideal) column H, is illustrating, if this is even possible, once the order quantity reaches 0, for the script to keep searching sheet for next order with same criteria and subtract remain quantity. Anything will help, I am currently doing this manually over the weekend and generally 150+ sales per week and is very time consuming.
In simple terms, I am trying to have a script go through each sale row and subtract quantity from the order sheet if the plant and part number are the same. I will sort the order sheet based on when they are do so it removes from correct order.
Thanks for any help!
I have two sheets, one with orders the second with sales.
I need help automatically subtracting from orders based on sales.
I am trying to develop a script that would run through every sale and if location and item are exactly the same, subtract quantity sold from the quantity ordered to give a "new due" quantity.
There will be sales with no order which is a non issue, but would be nice if those results could go to a different tab. Below is a summary of what is required in n00b terms.
<code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet1</code> is sold, <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet2</code> is order.
If <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet1</code> C2 & F2 are same as any row in <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet2</code> (A2,D2 are correlating fields) subtract <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet1</code>G2, from <code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;">Sheet2</code> F2.
A | B | C | D | E | F | G | |
---|---|---|---|---|---|---|---|
Type | Date | Ship To Address 1 | Ship To Address 2 | Ship Zip | Item | Qty | |
Invoice | Ohio | ||||||
Invoice | Oklahoma | ||||||
Invoice | TEXAS | ||||||
Invoice | TEXAS | ||||||
Invoice | Florida | ||||||
Invoice | Oklahoma | ||||||
Invoice | Mexico | ||||||
Invoice | Ohio |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5698[/TD]
[TD="align: right"]60[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5693[/TD]
[TD="align: right"]50[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]1/24/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5701[/TD]
[TD="align: right"]220[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5699[/TD]
[TD="align: right"]112[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]1/26/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5729[/TD]
[TD="align: right"]20[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5693[/TD]
[TD="align: right"]205[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5695[/TD]
[TD="align: right"]165[/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]1/25/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5698[/TD]
[TD="align: right"]45[/TD]
</tbody>
Sold
A | B | C | D | E | F | G | |
---|---|---|---|---|---|---|---|
Plant | IssueDate | PurchaseOrderNumber | PartNumber | Timing | Quantity | When | |
Texas | AI437B | D1843 | Immediate:Discrete | ||||
Oklahoma | AI589A | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Texas | AI437B | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Texas | AI437B | D1843 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Oklahoma | AI589A | D1882 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Oklahoma | AI589A | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Texas | AI437B | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Texas | AI437B | D1843 | Firm:Weekly Bucket (Monday through Sunday) | ||||
OHIO | AI589A | D1874 | Firm:Weekly Bucket (Monday through Sunday) | ||||
OHIO | AI589A | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Mexico | AI437B | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Mexico | AI589A | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Oklahoma | AI589A | D1882 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Oklahoma | AI589A | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Texas | AI437B | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Texas | AI437B | D1843 | Firm:Weekly Bucket (Monday through Sunday) | ||||
OHIO | AI589A | D1874 | Firm:Weekly Bucket (Monday through Sunday) | ||||
OHIO | AI589A | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Mexico | AI437B | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Mexico | AI589A | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Oklahoma | AI589A | D1882 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Oklahoma | AI589A | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||
Texas | AI437B | D1876 | Firm:Weekly Bucket (Monday through Sunday) |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]28[/TD]
[TD="align: right"]1/23/2017[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]1/23/2017[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]174[/TD]
[TD="align: right"]1/23/2017[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]205[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]110[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]10[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]60[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]11[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]12[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]13[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]164[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: center"]14[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]15[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]204[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]16[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]17[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]188[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]18[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]60[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]19[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]299[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]20[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]21[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]197[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: center"]22[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]2/13/2017[/TD]
[TD="align: center"]23[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]166[/TD]
[TD="align: right"]2/13/2017[/TD]
[TD="align: center"]24[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2/13/2017[/TD]
</tbody>
Order
A | B | C | D | E | F | G | H | |
---|---|---|---|---|---|---|---|---|
Plant | IssueDate | PurchaseOrderNumber | PartNumber | Timing | Quantity | When | ||
TEXAS | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
TEXAS | D1843 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
TEXAS | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
TEXAS | D1843 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
OHIO | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
Mexico | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
Mexico | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
Oklahoma | D1882 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
Oklahoma | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
TEXAS | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
TEXAS | D1843 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
OHIO | D1874 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
OHIO | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
Mexico | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
Oklahoma | D1882 | Firm:Weekly Bucket (Monday through Sunday) | (-37) | |||||
Oklahoma | D1852 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
TEXAS | D1876 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
TEXAS | D1882 | Firm:Weekly Bucket (Monday through Sunday) | ||||||
WOULD BE IDEAL RESULT FOR (F) |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: center"]2[/TD]
[TD="bgcolor: #FFFF00"]TEXAS[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1843[/TD]
[TD="bgcolor: #FFFF00"]Immediate:Discrete[/TD]
[TD="bgcolor: #C6EFCE, align: right"]-299[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="align: right"]0[/TD]
[TD="align: center"]3[/TD]
[TD="bgcolor: #FFFF00"]Oklahoma[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1852[/TD]
[TD="bgcolor: #FFFF00"]Firm:Weekly Bucket (Monday through Sunday)[/TD]
[TD="bgcolor: #C6EFCE, align: right"]-177[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/23/2017[/TD]
[TD="align: right"]0[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]1/23/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]174[/TD]
[TD="align: right"]1/23/2017[/TD]
[TD="align: right"]-45[/TD]
[TD="align: center"]6[/TD]
[TD="bgcolor: #FFFF00"]Oklahoma[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1882[/TD]
[TD="bgcolor: #FFFF00"]Firm:Weekly Bucket (Monday through Sunday)[/TD]
[TD="bgcolor: #C6EFCE, align: right"]-47[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/30/2017[/TD]
[TD="align: right"]0[/TD]
[TD="align: center"]7[/TD]
[TD="bgcolor: #FFFF00"]Oklahoma[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1852[/TD]
[TD="bgcolor: #FFFF00"]Firm:Weekly Bucket (Monday through Sunday)[/TD]
[TD="bgcolor: #FFFF00, align: right"]205[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/30/2017[/TD]
[TD="bgcolor: #FFC7CE, align: right"]28[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]110[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]10[/TD]
[TD="bgcolor: #FFFF00"]OHIO[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1874[/TD]
[TD="bgcolor: #FFFF00"]Firm:Weekly Bucket (Monday through Sunday)[/TD]
[TD="bgcolor: #C6EFCE, align: right"]0[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/30/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]11[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]-3[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: right"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]13[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]164[/TD]
[TD="align: right"]1/30/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]14[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]15[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]204[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]16[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]17[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]188[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]18[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]60[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]19[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]299[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"]296[/TD]
[TD="align: center"]20[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]21[/TD]
[TD="bgcolor: #FFFF00"]Mexico[/TD]
[TD="bgcolor: #FFFF00, align: right"]1/22/2017[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]
[TD="bgcolor: #FFFF00"]D1852[/TD]
[TD="bgcolor: #FFFF00"]Firm:Weekly Bucket (Monday through Sunday)[/TD]
[TD="bgcolor: #FFC7CE, align: right"]32[/TD]
[TD="bgcolor: #FFFF00, align: right"]2/6/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]22[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]2/13/2017[/TD]
[TD="align: center"]23[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]166[/TD]
[TD="align: right"]2/13/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]24[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2/13/2017[/TD]
[TD="align: right"][/TD]
[TD="align: center"]25[/TD]
[TD="align: right"]1/22/2017[/TD]
[TD="align: right"][/TD]
[TD="align: right"]110[/TD]
[TD="align: right"]2/20/2017[/TD]
[TD="align: right"]65[/TD]
[TD="align: center"]26[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
Results
On the results tab everything highlighted in yellow is what would have changed. Items not highlighted in yellow there was no sale. The green and red formatting was for reference and is not required if to difficult. (would be ideal) column H, is illustrating, if this is even possible, once the order quantity reaches 0, for the script to keep searching sheet for next order with same criteria and subtract remain quantity. Anything will help, I am currently doing this manually over the weekend and generally 150+ sales per week and is very time consuming.
In simple terms, I am trying to have a script go through each sale row and subtract quantity from the order sheet if the plant and part number are the same. I will sort the order sheet based on when they are do so it removes from correct order.
Thanks for any help!