=MAX(0,Sum_12+
IF([@[Review Cycle]]=1,
IF([@[receiving month]]=3,
-([@[7th of jan stock value -drp str and reserved]]-[@[avg cogs jan]]-[@[avg cogs feb]]),
IF([@[receiving month]]=4,
-[@[7th of jan stock value -drp str and reserved]]-[@[avg cogs jan]]-[@[avg cogs feb]]-[@[avg cogs mar]],
IF([@[receiving month]]=5,
-[@[May stock]],
IF([@[receiving month]]=6,
-[@[May stock]]-[@[avg cogs may]],[@[avg cogs jul]]+[@[avg cogs aug]]+0.5*[@[avg cogs sep]])))),
IF([@[Review Cycle]]=2,
IF([@[receiving month]]=3,
-[@[7th of jan stock value -drp str and reserved]]-[@[avg cogs jan]]-[@[avg cogs feb]],
IF([@[receiving month]]=4,
-[@[7th of jan stock value -drp str and reserved]]-[@[avg cogs mar]]-[@[avg cogs feb]]-[@[avg cogs jan]],
IF([@[receiving month]]=5,
-[@[May stock]],
IF([@[receiving month]]=6,
-[@[May stock]]-[@[avg cogs jun]],[@[avg cogs jul]]+[@[avg cogs aug]]+[@[avg cogs sep]]+0.5*[@[avg cogs oct]]-[@[May stock]]-[@[avg cogs jun]]-[@[avg cogs may]])))),
IF([@[Review Cycle]]=3,
IF([@[receiving month]]=3,
-([@[May stock]]+[@[avg cogs mar]]+[@[avg cogs apr]]),
IF([@[receiving month]]=4,
-([@[May stock]]-[@[avg cogs apr]]),
IF([@[receiving month]]=5,
-[@[May stock]],
IF([@[receiving month]]=6,
-[@[May stock]]-[@[avg cogs jun]],[@[avg cogs jul]]+[@[avg cogs aug]]+[@[avg cogs sep]]+[@[avg cogs oct]] +0.5*[@[avg cogs nov]]-[@[May stock]]-[@[avg cogs jun]]-[@[avg cogs may]])))),
IF([@[Review Cycle]]=4,
IF([@[receiving month]]=3,
-[@[7th of jan stock value -drp str and reserved]]-[@[avg cogs jan]]-[@[avg cogs feb]],
IF([@[receiving month]]=4,
-([@[May stock]]-[@[avg cogs apr]]),
IF([@[receiving month]]=5,
-[@[May stock]],
IF([@[receiving month]]=6,
-[@[May stock]]-[@[avg cogs jun]],+[@[avg cogs jul]]+[@[avg cogs aug]]+[@[avg cogs sep]]+[@[avg cogs oct]]+[@[avg cogs nov]]+0.5*[@[avg cogs dec]]-[@[May stock]]-[@[avg cogs may]]-[@[avg cogs jun]])))),
IF([@[Review Cycle]]=4,
IF([@[receiving month]]=3,
-[@[7th of jan stock value -drp str and reserved]]-[@[avg cogs jan]]-[@[avg cogs feb]],
IF([@[receiving month]]=4,
-[@[May stock]]+[@[avg cogs apr]],
IF([@[receiving month]]=5,
-[@[May stock]],
IF([@[receiving month]]=6,
-[@[May stock]]-[@[avg cogs may]],[@[avg cogs jul]]+5.5*[@[avg cogs]]-[@[May stock]]-[@[avg cogs jun]])))),
IF([@[Review Cycle]]=5,
IF([@[receiving month]]=3,
-[@[May stock]]-[@[avg cogs apr]]-[@[avg cogs mar]],
IF([@[receiving month]]=4,
-[@[May stock]]-[@[avg cogs apr]],
IF([@[receiving month]]=5,
-[@[May stock]],
IF([@[receiving month]]=6,
-[@[May stock]]-[@[avg cogs may]],[@[avg cogs jul]]+6.5*[@[avg cogs]]-[@[May stock]]-[@[avg cogs may]]-[@[avg cogs jun]])))),
IF([@[Review Cycle]]=6,
IF([@[receiving month]]=3,
-[@[May stock]]-[@[avg cogs apr]]-[@[avg cogs mar]],
IF([@[receiving month]]=4,
-[@[May stock]]-[@[avg cogs apr]],
IF([@[receiving month]]=5,
-[@[May stock]],
IF([@[receiving month]]=6,
-[@[May stock]]-[@[avg cogs may]],[@[avg cogs jul]]+7.5*[@[avg cogs]]-[@[May stock]]-[@[avg cogs may]]-[@[avg cogs jun]])))),
IF([@[receiving month]]=3,
-[@[May stock]]-[@[avg cogs apr]]-[@[avg cogs mar]],
IF([@[receiving month]]=4,
-[@[May stock]]-[@[avg cogs apr]],
IF([@[receiving month]]=5,
-[@[May stock]],
IF([@[receiving month]]=6,
-[@[May stock]]-[@[avg cogs may]]-[@[avg cogs jun]]
))))))))))))
This formula calculates Sum_12
=SUMPRODUCT((COLUMN($A$1:$L$1)>= [@[receiving month]])*(COLUMN($A$1:$L$1)<= [@[receiving month]]
+[@[Review Cycle]])+(COLUMN($A$1:$L$1)= [@[receiving month]]
+[@[Review Cycle]]+1)*0.5,[@[avg cogs jan]:[avg cogs dec]])
Bookmarks