Hi all,
I'm trying to do a simple calculation:
If the current month is May 2011 or later, 1,000,000, otherwise, 0
I tried:
=IF(MONTH(>5),1000000,0)
Which obviously doesn't work...
Is there an easy way to do this?
Hi all,
I'm trying to do a simple calculation:
If the current month is May 2011 or later, 1,000,000, otherwise, 0
I tried:
=IF(MONTH(>5),1000000,0)
Which obviously doesn't work...
Is there an easy way to do this?
Sorry, this is obviously in CALC...
It is just =IF(MONTH(cellreference)>5,1000000,0)
replace cellreference with the cell address where May 2011 is stored.
If you want the formula to automatically evaluate it based on today's date, then you can make it like below :
=IF(MONTH(TODAY())>5,1000000,0)
Hope this helps
Hi Tanstaafl,
=IF(NOW()=DATE(2011,5,1),1000000,0)
If the comparison is with the May 2011, instead of just being later
than May.
Since it is now past May 1, 2011, the same could be done in
reference to a cell with a date value. So, instead of now(), it could
be a reference to a cell with a date in it, or use datevalue if it is a
string.
Hi
A > instead of the 2nd = seems to work. eg
=IF(NOW()>DATE(2011,5,1),1000000,0)
Although you might need to change the 2011,5,1 to 2011,5,0 otherwise the 1st of
the month might not be included. Perhaps
=IF(NOW()>=DATE(2011,5,1),1000000,0)
would be better as it is "greater than or equal to".
Regards from
Tom
Duh! I was trying to type the formula manually and forgot the cell
reference...
Thanks for the gentle use of the cluestick...
Date sent: Wed, 25 May 2011 16:07:06 +0100 (BST)
number
Send reply to: users@libreoffice.org
Hi
A > instead of the 2nd = seems to work. eg
=IF(NOW()>DATE(2011,5,1),1000000,0)Although you might need to change the 2011,5,1 to 2011,5,0 otherwise the 1st of
the month might not be included. Perhaps=IF(NOW()>=DATE(2011,5,1),1000000,0)
would be better as it is "greater than or equal to".
I had actually done that, but copied the contents of an earlier cell?
But, it actually would only be an issue if it was exactly 5/1/2011 at
exactly midnight, since even one second after that would be
greater than. If comparing to a cell with a date value, it might have
the zero time value, so definitately the >= should be used.
Note that if you use the month( ) then it would be any date in
which the month is >5, so 6/1 thru 12/31 of any year.
Are the cells refereced entered as dates (numeric) or as strings?
Date sent: Wed, 25 May 2011 11:21:34 -0400
Copies to: Manoharan Durga
<durgamanoharan@gudalur.net>
number
Send reply to: users@libreoffice.org
Note that if you use the month( ) then it would be any date in
which the month is >5, so 6/1 thru 12/31 of any year.
Are the cells refereced entered as dates (numeric) or as strings?
There are no cells being referenced, I'm simply evaluating the CURRENT
date/Month...
Since I want prior years sheets to continue to evaluate positive, this
will work perfectly for me in this case.
Hmmmm...
Now that I think about it...
Do these evaluations occur in context of the *current* year? I'm
guessing the answer is yes, that would be the most logical thing to do.
If so, I think I will have to specify the year, otherwise, next year,
what is now this years sheet will start evaluating to false, since May
2011 is NOT > May 2012...
Is that correct?
Thanks very much for your help in getting this right...
Date sent:Wed, 25 May 2011 12:40:24 -0400