Welcome to the forum; nearly there:

=SUMIF(C:C,"x",D:D)

Regards, TMS