On 12 Jun 2015 at 8:49, Gordon Burgess-Parker wrote:

Date sent:              Fri, 12 Jun 2015 08:49:35 +0100
From:                   Gordon Burgess-Parker <[email protected]>
To:                     [email protected]
Subject:                Re: [libreoffice-users] Calc date formulae

> On 12/06/15 08:44, Dries Feys wrote:
> > If the date to check is in B3, try the following formula:
> >
> > =IF(WEEKDAY(B3)=1;B3-2;IF(WEEKDAY(B3)=7;B3-1;B3))
> >
> > Don't forget to format the target cell as a date ;-)
> >
> > Succes
> >
> 

Not sure why what I see in email sent isn't what I get on the list?
Column A has the date
Friday, June 12, 2015

Column B has the formula
=A1-(MOD(INT(A1),7)<2)*(MOD(INT(A1),7)+1)

Which uses the value of A1, Logical math then does if it is true that it is a 
Saturday or Sunday, it will then subtract the 1 or 2 to get the previous Friday 
Date. 

 Long ago, used a Zeller congruency formula to calculate day of week using 
mod. 0 - sat 1-sun ...

Hopefully, this will show up correctly.


> Great! Brilliant! Thanks very much!
> 
> 
> 
> -- 
> To unsubscribe e-mail to: [email protected]
> Problems? 
> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be deleted


+----------------------------------------------------------+
  Michael D. Setzer II -  Computer Science Instructor      
  Guam Community College  Computer Center                  
  mailto:[email protected]                            
  mailto:[email protected]
  http://www.guam.net/home/mikes
  Guam - Where America's Day Begins                        
  G4L Disk Imaging Project maintainer 
  http://sourceforge.net/projects/g4l/
+----------------------------------------------------------+

http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned:  19,471
Processing time:  32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)

BOINC@HOME CREDITS
ROSETTA     30650812.183751   |   SETI        54443841.296543
ABC         16613838.513356   |   EINSTEIN    63454530.308699


-- 
To unsubscribe e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to