Use Sumproduct to flag

DerekWooley

New Member
Joined
May 1, 2018
Messages
34
I am trying to see if there is a way to flag instances where a start date (Col E) is greater than that of a previous Machine Run. I have two items (29382 and 9384). The projected stock column is adding the machine run qty to current stock in the following machine run to I can see how much I will have. I have a column that marks the runs as preferred for each item on each machine in Col F. For Item 9384, it works perfectly and adds the mach run Qty across both machines for all 3 of the projected runs because the start date is always getting higher. For Item 29382, the 2nd projected run has a start date that is higher than the 3rd run so it does not add the run qty.

Below is my data table and the formula I am using for my projected stock.

The formula is looking for items that are “not preferred” on a certain machine and adding the run qty of a “preferred” to the stock of the future run. I would like to not even have to create a flag and just have the formula add the last run qty on the “preferred” machine to the first run on the “not preferred” machine and then add to the later runs on the not preferred machines whenever I create a new row or run. I am not sure if that is possible so I can settle for flagging the instances that have dates that are not less than a run on another machine.

Formula:
=IF(F3="Not Preferred",B3+SUMPRODUCT(--($A$3:$A$10=A3),--($D$3:$D$10=D3),--($E$3:$E$10<E3),$G$3:$G$10)+SUMPRODUCT(--($A$3:$A$10=A3),--($F$3:$F$10="Preferred"),--($E$3:$E$10<E3),$G$3:$G$10),B3+SUMPRODUCT(--($A$3:$A$10=A3),--($D$3:$D$10=D3),--($E$3:$E$10<E3),$G$3:$G$10))


Col A
Col B
Col C
Col D
Col E
Col F
Col G
Item No.
CUR STK
Projected Stock
Machine
Start Date
Preferred Machine
Mach Run Qty
29382
2500
2500
Mach 1
6/29/2018
Preferred
11,000
29382
2500
13500
Mach 1
2/23/2019
Preferred
17,000
29382
2500
13500
Mach 2
1/11/2019
Not Preferred
7,000
29382
2500
37500
Mach 2
1/14/2020
Not Preferred
8,000
9384
4500
4500
Mach 1
6/5/2018
Preferred
30,000
9384
4500
34500
Mach 1
8/8/2019
Preferred
50,000
9384
4500
84500
Mach 2
11/3/2019
Not Preferred
27,000
9384
4500
111500
Mach 2
1/4/2020
Not Preferred
27,000

<tbody>
</tbody>


Thank you for any help.
 
Last edited by a moderator:

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,214,585
Messages
6,120,397
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top