With this kind of Google Docs Spreadsheet:
How can I calculate SUM(C1:C8), but without values where the corresponding D column has a 0 (so, without C1 and C3)?
Try the following formula:
=SUMIF(D1:D8, "<>0", C1:C8)
Not described in the help is the use of
<>. This reads as
The rest is explained in the help: