Two problems:

1.
code:
$worksheet1.Range(C10).Formula = '=SUM(B2:B9)'

should be
code:
 $worksheet1.Range(C10).Formula = '=SUM(C2:C9)' 

2. Your COUNTIF syntax is incorrect:
code:
'=COUNTIF(B2:B9;"Jimmy")'

should be
code:
'=COUNTIF(B2:B9,"Jimmy")'

If it detects an error in the formula, it will not apply the formula to the cell.
_________________________
Stevie