I use the following formula to calculate the days between dates and to return zero when dates are the same –

=IF(OR(A1="",A2=""),0,DATEDIF(A1,A2, "d"))
How would I also allow for the eventuality where the date in cell A2 is earlier than A1 and where the result would then be a minus figure ?

At present the formula returns a "Num" error when this happens