I cannot figure out how this formula calculates weeks of supply in a spreadsheet I'm working on. The formula below returns the weeks of supply we have on hand today. Columns FV:HN are the weekly demand forecast, with column FV being week 35 (current week). Column CN is the current inventory available.
I mainly don't understand the SUBTOTAL and OFFSET pieces. The SUMPRODUCT is just there to return a zero and avoid negative weeks of supply, I think? But if I remove that part I get the #SPILL! error
=SUMPRODUCT(--(SUBTOTAL(9,OFFSET(FV163:$HN163,,,,COLUMN(FV163:$HN163)-COLUMN(FV163)+1))<=CN163))
I mainly don't understand the SUBTOTAL and OFFSET pieces. The SUMPRODUCT is just there to return a zero and avoid negative weeks of supply, I think? But if I remove that part I get the #SPILL! error
=SUMPRODUCT(--(SUBTOTAL(9,OFFSET(FV163:$HN163,,,,COLUMN(FV163:$HN163)-COLUMN(FV163)+1))<=CN163))