Implemented in OP's sample file (sent over)
---------------------------
Put in Q6: =IF($F$1="","",SUM(OFFSET($D6,,,,$F$1)))
Copy down
Adapt to suit your continental Excel ..
(replace commas [separator] with semicolons)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---