Help for this page
$Sheet->Range("H$lastrow4")->{Formula} = '=sum("H17:H.$Lastrow3")';
$Sheet->Range("H$lastrow4")->{Formula} = qq{=sum("H17:H.$Lastrow3")};