Perhaps OP means if 0 appears in either cell ignore - as opposed to just in D ?

=CORREL(IF(C3:C9*D3:D9,C3:C9),IF(C3:C9*D3:D9,D3:D9))
confirmed with CTRL + SHIFT + ENTER