ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Volatile Symbol (https://www.excelbanter.com/excel-discussion-misc-queries/228333-volatile-symbol.html)

Doug

Volatile Symbol
 
In the date formula below, in VBA, what does "()" mean"? The formula checker
says it is "volatile". I believe I may have mis-applied the formula, since
it is not counting the number of days between dates correctly. Please advise.

=IF(F11-TODAY()<365,"YES","NO")

DOUG

Benji

Volatile Symbol
 
Try reversing the symbols, though from the forumla, you may not even need them
--
Learning without thought is labor lost.

Thought without learning is perilous.


"DOUG" wrote:

In the date formula below, in VBA, what does "()" mean"? The formula checker
says it is "volatile". I believe I may have mis-applied the formula, since
it is not counting the number of days between dates correctly. Please advise.

=IF(F11-TODAY()<365,"YES","NO")

DOUG


Benji

Volatile Symbol
 
Actually, yes, removing your parentheses should fix the problem
--
Learning without thought is labor lost.

Thought without learning is perilous.


"Benji" wrote:

Try reversing the symbols, though from the forumla, you may not even need them
--
Learning without thought is labor lost.

Thought without learning is perilous.


"DOUG" wrote:

In the date formula below, in VBA, what does "()" mean"? The formula checker
says it is "volatile". I believe I may have mis-applied the formula, since
it is not counting the number of days between dates correctly. Please advise.

=IF(F11-TODAY()<365,"YES","NO")

DOUG


Roger Govier[_3_]

Volatile Symbol
 
Hi Doug

There is nothing wrong with your formula, if it is in a cell in a worksheet.
Today() is a volatile function, meaning that it has to recalculate whenever
there is a change in the spreadsheet.

=Today() will return an Excel date for today's value e.g. 21 Apr 2009, hence
if you have a valid Excel date in cell F1,
the formula will take one date from the other, and if the difference is less
than 365 days it will return Yes, otherwise it will return No
The formula could return what you might regard as a False "Yes", however, if
the date in cell F11 is ahead of Today, as it will return a negative
number - which of course is less than 365.

If you wanted to be sure that the date was not ahead of Today's date, then
you would need to include an AND statement.
=IF(AND(Today()<=F11,F11-TODAY()<365),"Yes","No")

You mentioned VBA in your Post, but I am assuming you meant a Worksheet
formula.
Within VBA, Today() is not recognised. You have to use Date.

--
Regards
Roger Govier

"DOUG" wrote in message
...
In the date formula below, in VBA, what does "()" mean"? The formula
checker
says it is "volatile". I believe I may have mis-applied the formula,
since
it is not counting the number of days between dates correctly. Please
advise.

=IF(F11-TODAY()<365,"YES","NO")

DOUG



Doug

Volatile Symbol
 
Benji: Thank you. Actually, the formula I hit upon was as follows...

=IF(TODAY()-N2=365,"YES","NO")

It did not work the other way, because it yielded a negative number. So,
reversing the order was the correct solution. But, the first time I tried
it, it did not work as my syntax was a little bit off. MS Excel lept in to
help me in this case, and all is well with the world.

Sincerely,
DOUG

"Benji" wrote:

Actually, yes, removing your parentheses should fix the problem
--
Learning without thought is labor lost.

Thought without learning is perilous.


"Benji" wrote:

Try reversing the symbols, though from the forumla, you may not even need them
--
Learning without thought is labor lost.

Thought without learning is perilous.


"DOUG" wrote:

In the date formula below, in VBA, what does "()" mean"? The formula checker
says it is "volatile". I believe I may have mis-applied the formula, since
it is not counting the number of days between dates correctly. Please advise.

=IF(F11-TODAY()<365,"YES","NO")

DOUG



All times are GMT +1. The time now is 02:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com