Hi,

Two possibilites:

=SUM(OFFSET(A1,,,,F1))

or

=SUM(A1:INDEX($1:$1,,F1) )

Regards