Morning and Happy Monday.

I have two cells i need help with.. Cell (L) will show either debit or credit and Cell P has numbers. I am trying to write a formula that goes =if L17="Debit" then convert cell P17 to a negative number (-).