Lookup multiple values and compare different scenarios to get a specific result

In the attached sheet I want formula in column C that will give the new order quantity with following logic;

If ("Product"="Product")of column A & I, ("Closing Stock" of particular product<"ROL" of particular product) & (Current "Date" (say date in B5 if formula is being applied in C5)-Any latest previous "New Order" Date>="Lead Time" of that product)

Means if it has given new order quantity once then it should not give it again within the lead time even though the closing stock is less than the ROL. For example if it gives 150 in C3 then 150 comes on or after 21.03.2014.

Our formula should perform the 3rd logic only if it finds any new order qty in Array C otherwise first 2 logic are enough.

Thanks in anticipation.

AttachmentSize
Sample Sheet.xlsx11.13 KB

Lookup multiple values and compare different scenarios to get a

Any buddy can help me out of the above mentioned formula?

The problem worked out

The problem worked out finally.
However thanks for all the support.