Given Calc where DATE(YYYY,MM,DD) and WEEKDAY(X) results 1 = Sunday, 2 =
Monday ... 6 = Friday, 7 = Saturday.
Solve for the first week of the month (WD = 1)

Variables
YYYY = 2017 desired year,
MM = 10 = desired month,
d1 = 1 = First day of the month
WC = 3 = Weekday code for Tuesday
WD = 1 = Week Desired = (1 First week, 2 Second week {maximum of week 4})
WO = WD*7-6 = Week Desired Offset

Solve for
DD = desired day

:. Find the weekday for the first day of the month
X =WEEKDAY(DATE(YYYY,MM,d1))

:. Find the Desired Day
DD =IF(WD-X+1>0,WD-X+WO,WD-X+WO+7)

Proof = WEEKDAY(DATE(YYYY,MM,DD)) = 3

On 29 September 2017 at 05:09, Alexander Thurgood <alex.thurg...@gmail.com>
wrote:

> Le 28/09/2017 à 17:02, Michael D. Setzer II a écrit :
>
> Hi Michael,
>
>
> > Well, hope you got the one sent to your direct email. This list doesn't
> seem to
> > allow either attached spreadsheets or images.  Hopefully, others can
> figure
> > out the formula, or if requested can send anyone a copy of the
> spreadsheet
> > to an email that will accept it.
> >
>
>
> Yes, the list scrubs attachments on inbound mail.
>
>
> Alex
>
>
> --
> To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
> 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
>

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
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