Calculated field ("last day in week") returning peculiar answer
I created a list that allows the user to enter a SharePoint "Date", called myDate. I created a calculated field called "myEndOfWeek" using this formula:= myDate + (7-1) - weekday(myDate)I expect it to return the date (number from 1-30) of the Friday ending the week that myDate lies in. For myDate = "02/18/2010", it returns 40,228 ??? What am I doing wrong and what is the correct formula to use?TIA,barkingdog
February 18th, 2010 12:15pm

Hi barkingdog, you should try = day(myDate +6 - weekday(myDate)) since your formula will give back the complete date of the result day which is 40,288 as number for "02/19/2010" (you can see that by formatting the column as date). The day function will remove the date and year and only give you a day between 1 and 31 which is the friday of the regardsMOSS_Test_Dummy
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2010 1:55pm

Your updated formula does the trick. Thanks.Barkingdog
February 18th, 2010 5:54pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics