On 25 May 2011 at 12:40, Tanstaafl wrote:
Date sent:Wed, 25 May 2011 12:40:24 -0400 From:[email protected] To:[email protected] Subject:Re: [libreoffice-users] Calculating the month number Send reply to:[email protected] On 2011-05-25 12:34 PM, Tanstaafl wrote: On 2011-05-25 11:37 AM, Michael D. Setzer II wrote: Note that if you use the month( ) then it would be any date in which the month is5, 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 NOTMay 2012... One would need to know exactly what the conditions are to meet your needs. =if(a1=date(2011,5,1),1000000,0) would give 100000 for any date on or after 2011/05/01. =if(month(a1)=5,1000000,0) would give 1000000 for any date ????/05/01 thru ????/12/31 The year would not make any difference. On the other hand, this would take in account the year =IF(AND(MONTH(A1)=5,YEAR(A1)=YEAR(NOW())),1000000,0) But the problem would be that if you look at the sheet on before 2012/01/01, then date of 5/1/2011 would give true, but then it would give false on 1/1/2012? Instead of using now() in the sheet, you might want to a cell with the current year for that sheet. So, in cell G1, I placed =date(2011,1,1) =IF(AND((MONTH(A1)=5),YEAR(A1)=YEAR($G$1)),1000000,0) Note the $G$1 is to make the address absolute, so when you copy the formula. This way, within a sheet the function would return the value in regards to the year for that sheet instead of regards to the current year. One needs to be very clear on what one want to do? Is that correct? Thanks very much for your help in getting this right... -- Unsubscribe instructions: E-mail to [email protected] Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/www/users/ All messages sent to this list will be publicly archived and cannot be deleted -- Unsubscribe instructions: E-mail to [email protected] Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/www/users/ All messages sent to this list will be publicly archived and cannot be deleted
