How do you exclude zeros from being included in correlation functions?

1 0
2 3
2 0
1 0
3 0
3 3
3 2
2 3


If that was a spreadsheet, I would want to calculate the correlation between the pairs without a zero.

I have tried this formula without success.

=CORREL((IF(D3:D9<>0,C3:C9,"")),(IF(D3:D9<>0,D3:D9,"")))

Thank you for your help