• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Datedif

Muchemi

New Member
=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,

kindly help
 
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)
 
If it's number of days. You can just use subtraction. As Excel stores dates in integer value.

DATEDIF is only needed for weeks or months difference.

Ex: =F5 - H5

If you don't want the negative difference, you can always nest it in ABS().
 
the problem is in that sample sheets if date came is less or greater than scheduled there is a error
 

Attachments

  • DATA NEED.xlsx
    35.7 KB · Views: 5
Back
Top