#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 460
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 460
Default 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

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
INDEX - volatile or not? T. Valko Excel Worksheet Functions 8 February 23rd 07 07:24 PM
is MATCH a volatile function? Dave F Excel Discussion (Misc queries) 3 January 31st 07 07:05 PM
formula result=Volatile BCNU Excel Discussion (Misc queries) 2 January 5th 07 06:00 AM
why is the INDIRECT function volatile? Dave F Excel Worksheet Functions 2 October 25th 06 02:10 PM
is there a NON-volatile version of INDIRECT ?? spiderman Excel Discussion (Misc queries) 1 February 4th 05 04:54 PM


All times are GMT +1. The time now is 01:24 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"