=IF(H5="","",IF(F5<H5,DATEDIF(H5,F5,"d"),-1*DATEDIF(F5,H5,"d")))
Iam trying this formula to get days difference between two dates, so far its working but when date 2 is less than date 1 error occurs,
The syntax is DATEDIF(start_date,end_date,"d")
=IF(H5="","",IF(F5<H5,DATEDIF(F5,H5,"d"),DATEDIF(H5,F5,"d")))
(I don't know what the -1 is for in your example)