I'm trying to create an IF statement in excel, I did a a level in ICT college which included quite a lot of IF statements, but that seems along time ago. I'm trying to create statement that shows a value but which, If a cell = "Y" then it will subtract the price from the cell to its left from the value

I've attempted to use this formula

=IF(D3:D14="Y",SUM(C16-C3:C14))

With no luck, I know I'm missing a lot but I just can't remember.

Can anyone help?