#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default DateDIFF

Paul,

Try

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


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



"Paul Breslin" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is DateDiff function in Excel 2002 ? Nigel Welch Excel Worksheet Functions 4 March 4th 05 03:18 PM
Help with datediff vba John Excel Programming 4 February 16th 05 01:56 PM
DateDiff in Excel JE McGimpsey Excel Programming 0 May 11th 04 05:07 PM
Application.WorkSheetFunction.DafeDif (not DateDiff) Rick[_19_] Excel Programming 3 January 8th 04 05:31 PM
DateDiff problem Antje Crawford Excel Programming 3 July 8th 03 09:44 PM


All times are GMT +1. The time now is 09:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"