Option Explicit
Sub InstallerFormules()
Dim L As Long
For L = 9 To 100 Step 13
Range(Cells(L, "D"), Cells(L, "AD")).FormulaR1C1 = "=IF(ISBLANK(R[-2]C),0,R[-3]C)"
Range(Cells(L + 3, "B"), Cells(L + 8, "B")).FormulaR1C1 = "=""PF ""&ROWS(R" & L + 3 & ":R)"
Cells(L + 3, "C").FormulaR1C1 = "=MIN(R" & L & "C,R" & L + 2 & "C)"
Range(Cells(L + 4, "C"), Cells(L + 8, "C")).FormulaR1C1 = "=MIN(MAX(R" & L & "C-SUM(R" & L + 3 & "C:R[-1]C),0),R" & L + 2 & "C)"
Cells(L + 3, "D").FormulaR1C1 = "=MIN(R" & L & "C,RC3)"
Range(Cells(L + 4, "D"), Cells(L + 8, "D")).FormulaR1C1 = "=MIN(MAX(R" & L & "C-SUM(R" & L + 3 & "C:R[-1]C),0),RC3)"
Range(Cells(L + 3, "E"), Cells(L + 3, "AD")).FormulaR1C1 = "=MIN(R" & L & "C,MAX(RC3-SUM(RC4:RC[-1]:RC4),0))"
Range(Cells(L + 4, "E"), Cells(L + 8, "AD")).FormulaR1C1 = "=MIN(MAX(R" & L & "C-SUM(R" & L + 3 & "C:R[-1]C),0),MAX(RC3-SUM(RC[-1]:RC4),0))"
Range(Cells(L + 10, "D"), Cells(L + 10, "AD")).FormulaR1C1 = "=R[-13]C-SUM(R[-7]C:R[-2]C)"
Next L
End Sub