+ Reply to Thread
Results 1 to 2 of 2

How do I calculate the number of dates between two date fields?

  1. #1
    Registered User
    Join Date
    02-22-2013
    Location
    Poughkeepsie, NY
    MS-Off Ver
    Excel 2003
    Posts
    1

    How do I calculate the number of dates between two date fields?

    Hello Everyone,

    I have two columns, OpenDate and CloseDate. They are formatted as type DATE.

    I need to know the number of days between the date an issue was opened and when it was closed. If CloseDate is blank, then the issue is still open, so the calculation should use today's date to do the calculation.

    Here's what I was initially thinking: C2 is a field in the CloseDate Column, and B2 is a field in OpenDate

    =IF(ISBLANK(C2),DATEVALUE(TODAY())-DATEVALUE(B2), DATEVALUE(C2)-DATEVALUE(B2))

    This of course just returns #VALUE!

    I think it's because the DATEVALUE function needs a string to operate on, and isn't looking in the cell?

    Any suggestions?

    Thanks in advance for your help!
    Bill

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How do I calculate the number of dates between two date fields?

    Use
    Please Login or Register  to view this content.
    Format as General
    Life's a spreadsheet, Excel!
    Say thanks, Click *

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1