+ Reply to Thread
Results 1 to 2 of 2

DateDIFF

  1. #1
    Paul Breslin
    Guest

    DateDIFF

    Hello -

    I have a spreadsheet where I store the names and expiration dates of a
    number of documents.
    I have a cell where I place a NOW()
    In a column next to the expiration date of each document I have placed a
    DateDIF which checks the interval between NOW() and the date of the
    document's expiration and returns the number of days until the document
    expires.
    Here, the current date (NOW()) is stored in cell C1, the document expiration
    date resides in E63, and the interval is days D. Like this:
    =DATEDIF($C$1,$E$63, "D")
    This works fine until the document has actually expired and then I get a
    #NUM! error.
    I would like some code to change this #NUM! to 'EXPIRED'

    Thanks,
    Paul



  2. #2
    Chip Pearson
    Guest

    Re: DateDIFF

    Paul,

    Try

    =IF(ISERROR(DATEDIF($C$1,$E$63,"D")),"EXPIRED",DATEDIF($C$1,$E$63,"D"))


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "Paul Breslin" <pbreslin@bellsouth.net> wrote in message
    news:Zhgnf.8695$MA2.7699@bignews6.bellsouth.net...
    > Hello -
    >
    > I have a spreadsheet where I store the names and expiration
    > dates of a number of documents.
    > I have a cell where I place a NOW()
    > In a column next to the expiration date of each document I have
    > placed a DateDIF which checks the interval between NOW() and
    > the date of the document's expiration and returns the number of
    > days until the document expires.
    > Here, the current date (NOW()) is stored in cell C1, the
    > document expiration date resides in E63, and the interval is
    > days D. Like this: =DATEDIF($C$1,$E$63, "D")
    > This works fine until the document has actually expired and
    > then I get a #NUM! error.
    > I would like some code to change this #NUM! to 'EXPIRED'
    >
    > Thanks,
    > Paul
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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