I would use a helper cell as I suggested in my other reply. Just remove the
references to E9:F9 -
A1 = helper cell formula:
=IF(OR(VLOOKUP($D9,Period1,3,0)=0,VLOOKUP($D9,Period2,3,0)=0),0,"OK")
Then:
=IF(A1=0,"",ROUNDDOWN(......))
Or, you could add the formula above to the front of your current formula but
look how long and ugly it gets:
=IF(OR(VLOOKUP($D9,Period1,3,0)=0,VLOOKUP($D9,Period2,3,0)=0),"",ROUNDDOWN((VLOOKUP($D9,Period1,VLOOKUP(I$6,Columns,3,FALSE),FALSE)/VLOOKUP($D9,Period1,3,FALSE)*$E9)+(VLOOKUP($D9,Period2,VLOOKUP(I$6,Columns,3,FALSE),FALSE)/VLOOKUP($D9,Period2,3,FALSE)*$F9),0))