Diference between two dates depending on which one is bigger

Diference between two dates depending on which one is bigger

Hello,

I'm Trying to create a formula field that calculates the diference in days between 2 dates,
i have the closing date, the created time and the now()

i want to do now()-created time if the now< closing date
and closing date-created time other wise

so far i have this formula 
If(
Datecomp(${Opportunities.Closing Date},Now())>0,
Datecomp(now(),${Opportunities.Created Time})/1440,
Datecomp(${Opportunities.Closing Date},${Opportunities.Created Time})/1440
)

but it says "You used the wrong type of data in an argument. Check what you entered between the parentheses of your functions to make sure you put the right kind of data in the right place."

can you help me correct this error?