calculate date difference and use result as condition

  • Thread starter Thread starter as_sass
  • Start date Start date
A

as_sass

Hey! I would appreciate any help or input from you guys on the followin
problem I have encountered:

I would like to write a user defined function that does the following:

- calculates the difference between the current date (preferabl
'grabbed' from the system's date/time) and a date i specify in th
function (NOT in the spreadsheet)

- then performs one of two actions, depending on the amount of day
elapsed (see above)

-To make it even more tricky, one of these two things is also
conditional (if, then, else, etc), depending on sth. in th
spreadsheet.

I have very limited knowledge of user defined functions, and all I hav
written is based on modifying scripts for already existing functions.
cannot find a template for this problem, though.

To rephrase my problem; the function should work like this: "Check i
date difference today-specified date > X days. If yes, perform: If cel
X1=X, then X, else, X. If date difference today-specified date <
days, return the following statement: X"

Can anybody help?

Thanks!

a
 
Assuming the following:

Criteria for the difference in dates is 5 days
B1 has the value to compare to
Statement if less than 5 days is "Less than 5 days"


=IF(TODAY()-DATEVALUE("3/1/2004")>5,IF(B1=10,"Yes","No"),"Less than 5 days")

Hope this helps!

On 5/3/04 6:54 PM, in article (e-mail address removed), "as_sass
 
Back
Top