Results 1 to 2 of 2

Thread: Question about DateDif
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular MyExcel's Avatar
    Join Date
    Sep 2008
    Posts
    508
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Question about DateDif

    when i use the difference Between tow date i add 1
    for example
    C1 = 1/1/2009
    C2 = 15/1/2009
    C3 = C2-C1+1
    the result = 15
    but when i use
    DATEDIF(C1,C2,"d") = 14

    what is the correct ????

  2. #2
    MrExcel MVP
    Moderator
    barry houdini's Avatar
    Join Date
    Mar 2005
    Location
    England
    Posts
    20,825
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Question about DateDif

    Neither is wrong, it just depends on your requirement. I wouldn't use DATEDIF at all for the days difference between two dates, use either

    =C2-C1+1

    or just

    =C2-C1

    Let's assume that C1 is today and C2 is tomorrow. If you want the difference to be 2, perhaps because your requirement is from the start of the first day to the end of the latter, then use the first formula

    If you think the difference is 1, perhaps measuring from a specific time on one day to the same time on the other, then use tghe second formula

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •