Update Closing Date with another field date

Update Closing Date with another field date

Hello,

I have three dates:

Pre-order date
Order date
Closing date

I need the closing date to be updated with these dates, based on two different scenarios:

1. If pre-order date is completed, then Closing Date = Pre-order date
2. If Order date is completed AND pre-order date is empty, THEN Closing Date = Order Date

Therefore if Pre-order date is completed and later Closing Date is completed as well, THEN Closing Date must remain as Pre-order Date.

if you could send me a function that makes this happen will be much appreciated! 

Thank you