Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Calculating time between 2 dates DATEDIF Function

  1. #1
    Board Regular CDICKENS's Avatar
    Join Date
    Mar 2002
    Location
    Tarheel State
    Posts
    498
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I want to calculate the number of days between 2 dates. The start_date is in A1 and the end_date is in A2.

    When I format the function like this:
    DATEDIF(A1,A2,D) I get the #NAME? error.

    So I then tried it like this,
    DATEDIF("A1","A2",D) I get the #value! error.

    Since I already have the dates in the worksheet I do not want to enter them into the formula each time.

    Help

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Put the D in quotes

    "d"

  3. #3
    Board Regular CDICKENS's Avatar
    Join Date
    Mar 2002
    Location
    Tarheel State
    Posts
    498
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks I believe that worked!!

  4. #4
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    83,658
    Post Thanks / Like
    Mentioned
    33 Post(s)
    Tagged
    6 Thread(s)

    Default

    On 2002-04-28 13:52, CDICKENS wrote:
    Thanks I believe that worked!!
    =A2-A1

    will also work. Need to format the cell of the formula as General.

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
  •