#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default DateDIF

Hello --

I have to keep track of a number of certificates and licenses.
I have a sheet where I have in a column when the license was obtained and
another column when the license expires. There is a third column that
calculates the difference in days between the two.
When the certificate expires I get an out of range error.
Can I capture that error and make the cell simply say: "Expired" ?

Thanks,
Paul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default DateDIF

Hi Paul

You don't provide much detail on how and where this is done, but try
something like
=IF(B1<A1,"expired",B1-A1)

HTH. Best wishes Harald

"Paul Breslin" skrev i melding
.. .
Hello --

I have to keep track of a number of certificates and licenses.
I have a sheet where I have in a column when the license was obtained and
another column when the license expires. There is a third column that
calculates the difference in days between the two.
When the certificate expires I get an out of range error.
Can I capture that error and make the cell simply say: "Expired" ?

Thanks,
Paul




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default DateDIF

OK, let me be more specific ...

Here are the cell values:
In cell C1 I list today's date with a "NOW()"

On the worksheet I use these values:
A10 = a consecutive number
B10 = the name of a license of certificate
C10 = the date of the last survey
D10 = the date of the next survey
E10 = the expiration date
F10 = Days until expiration

It is in cell F10 I have: =DATEDIF($C$1,$E$10,"D")

This works very well giving the number of days until expiration. The
function looks at the current date in C1 and looks at the date in E10 and
calculates the number of days until expiration.
However, if the certificate had expired; that is, if the value in E10 is
less than the value in C1, then the function returns "#NUM". I want to stop
that and have it return "EXPIRED" instead.

Thanks,
Paul
----------

"Harald Staff" wrote in message
...
Hi Paul

You don't provide much detail on how and where this is done, but try
something like
=IF(B1<A1,"expired",B1-A1)

HTH. Best wishes Harald

"Paul Breslin" skrev i melding
.. .
Hello --

I have to keep track of a number of certificates and licenses.
I have a sheet where I have in a column when the license was obtained and
another column when the license expires. There is a third column that
calculates the difference in days between the two.
When the certificate expires I get an out of range error.
Can I capture that error and make the cell simply say: "Expired" ?

Thanks,
Paul






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default DateDIF

I see. You did try to implement my suggestion ?
=IF(E10<$C$1,"expired",E10-$C$1)

HTH. Best wishes Harald

"Paul Breslin" skrev i melding
.. .
OK, let me be more specific ...

Here are the cell values:
In cell C1 I list today's date with a "NOW()"

On the worksheet I use these values:
A10 = a consecutive number
B10 = the name of a license of certificate
C10 = the date of the last survey
D10 = the date of the next survey
E10 = the expiration date
F10 = Days until expiration

It is in cell F10 I have: =DATEDIF($C$1,$E$10,"D")

This works very well giving the number of days until expiration. The
function looks at the current date in C1 and looks at the date in E10 and
calculates the number of days until expiration.
However, if the certificate had expired; that is, if the value in E10 is
less than the value in C1, then the function returns "#NUM". I want to

stop
that and have it return "EXPIRED" instead.

Thanks,
Paul
----------

"Harald Staff" wrote in message
...
Hi Paul

You don't provide much detail on how and where this is done, but try
something like
=IF(B1<A1,"expired",B1-A1)

HTH. Best wishes Harald

"Paul Breslin" skrev i melding
.. .
Hello --

I have to keep track of a number of certificates and licenses.
I have a sheet where I have in a column when the license was obtained

and
another column when the license expires. There is a third column that
calculates the difference in days between the two.
When the certificate expires I get an out of range error.
Can I capture that error and make the cell simply say: "Expired" ?

Thanks,
Paul








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default DateDIF

Yes, this works very well - thank you.
And, by manipulating the decimals, setting them to zero, it shows the number
of days until expiration as whole days.
Thanks again,
Paul


"Harald Staff" wrote in message
...
I see. You did try to implement my suggestion ?
=IF(E10<$C$1,"expired",E10-$C$1)

HTH. Best wishes Harald

"Paul Breslin" skrev i melding
.. .
OK, let me be more specific ...

Here are the cell values:
In cell C1 I list today's date with a "NOW()"

On the worksheet I use these values:
A10 = a consecutive number
B10 = the name of a license of certificate
C10 = the date of the last survey
D10 = the date of the next survey
E10 = the expiration date
F10 = Days until expiration

It is in cell F10 I have: =DATEDIF($C$1,$E$10,"D")

This works very well giving the number of days until expiration. The
function looks at the current date in C1 and looks at the date in E10 and
calculates the number of days until expiration.
However, if the certificate had expired; that is, if the value in E10 is
less than the value in C1, then the function returns "#NUM". I want to

stop
that and have it return "EXPIRED" instead.

Thanks,
Paul
----------

"Harald Staff" wrote in message
...
Hi Paul

You don't provide much detail on how and where this is done, but try
something like
=IF(B1<A1,"expired",B1-A1)

HTH. Best wishes Harald

"Paul Breslin" skrev i melding
.. .
Hello --

I have to keep track of a number of certificates and licenses.
I have a sheet where I have in a column when the license was obtained

and
another column when the license expires. There is a third column that
calculates the difference in days between the two.
When the certificate expires I get an out of range error.
Can I capture that error and make the cell simply say: "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
DATEDIF? Ken Excel Discussion (Misc queries) 7 March 30th 09 10:24 PM
Datedif [email protected] Excel Worksheet Functions 3 December 22nd 08 12:30 PM
Datedif() Brad Excel Discussion (Misc queries) 6 October 29th 08 06:35 PM
DATEDIF Deborah Excel Worksheet Functions 11 September 12th 07 04:06 PM
DateDif Average? Damn DateDif UTCHELP Excel Worksheet Functions 14 November 17th 05 10:30 AM


All times are GMT +1. The time now is 06:48 PM.

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

About Us

"It's about Microsoft Excel"