Hello All

I have attached my simple worksheet and need help figuring out how to create a dynamic sumif formula. In the attached worksheet the following apply:

1. Cell A2 contains the in service period
2. Row 5 columns B:CG contain the number of weeks per fiscal period
3. Row 6 columns B:CG contain the fiscal period ID
4. Row 7 columns B:CG is where my formula is needed

If the in service period is 201510 I would like the sum function to start summing the weeks in cell Q5 and continue to increase the sum range as you work from column to column to the right. In other words Cell Q7=4, R7=8, S7=13, ...

I think I may not be describing my need as clearly as possible but I hope you pros can help.

I appreciate all of your time and input.

Thank you

Excel Example.xlsx