FindMonday ( input )
finds date of Monday in week of any given date
Average rating: 4.5 (26 votes) Log in to vote
Darrin Morton Neocode Software http://www.neocodesoftware.com |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Finds the date of the Monday in the week of any given date. Always assumes by convention that Sunday is the first day of the week. (day 1)
input - ( DayOfWeek ( input ) ) + 2
Comments
Daniele Raybaudi, ACI Aug 2, 2013 |
||
What about: input - DayOfWeek ( input ) + 2 |
||
Darrin Morton, Victoria, BC Aug 2, 2013 |
||
thank you daniele, you were right, your suggestion needed a minor tweak that incorporated, works great | ||
Daniele Raybaudi, ACI Aug 3, 2013 |
||
It works even without the added parentheses | ||
Brian Rich, Hampshire, UK Jun 23, 2014 |
||
This doesn't give a correct result if the day of the week input is a Sunday. It returns the Monday after, not the Monday before. If you alter the function to this: input - DayOfWeek ( input -1 ) + 1 then it gives the previous Monday when a Sunday is specified. It may be that some people want to calculate it as Darrin specifies, but I was caught out by the Sunday date so thought it best recorded here. Thanks for a useful function though Brian |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.