Archive of Mr Excel Message Board


Back to Forms in Excel VBA archive index
Back to archive home

calculate due date and give a warning message

Posted by HY on January 15, 2002 6:00 AM
HELP
how can i:
- calculate yearly expiration date = (A)
- substract (A) from TODAY to get how many days left and options to get '+' and '-'
- get a warning message saying we are "OK" or "WARNING - TIME TO RENEW"
thanks


Check out our Excel Resources

Re: calculate due date and give a warning message

Posted by Dan on January 15, 2002 9:30 AM
Couple of things...When you say you want to calculate yearly expiration date, how do you want to calculate it? From what date? See if this helps.

Lets say you have a beginning date in cell A1. In cell B1, you can calculate the expiration date as 1 year from beginning date by formatting the cell as a date and using the formula:
=EDATE(A1,12)

In cell C1, you can calculate days left by formatting the date as a number with 0 decimal places and using the formula:
=B1-Now()

In cell D1, you can get a warning message by using the formula:
=IF(C1>=0,"OK","Warning - Time to Renew")

Hope that helps you get started.


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.