Welcome to the Smartsheet Forum Archives
The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, pleaseVisit the Current Forums.
Week Ending Date
Hello, I am creating a Safety Audit Database. Similar to Scheduling principles, we keep track of all data entries by two dates. ACTUAL DATE and WEEK ENDING DATE (where Week Ending date is Sunday)
We use a formula in Excel to do this but I am not able to replicate such formula in smartsheet.
Does anyone know how to do this? change an actual date from one column to a WEEK ENDING into another column. This way I can TIE all DATA based on Project and Week Ending Date to match all of our current reporting.
The formula in Excel is:
=(7-WEEKDAY(A1,2))+A1
Any help is appreciated.
Thanks,
Comments
-
Shaine Greenwood Employee
Hi jgomeztagle!
If I'm understanding you correctly, you're wanting to return the next Sunday as your week ending date. Smartsheet has to do this differently, because the WEEKDAY function doesn't allow you to start counting from a specific day of the week like Excel's does with the "2" argument in your example.
This formula, albeit long, should do the trick:
=IF(WEEKDAY([Start Date]9) = 1, [Start Date]9 + 7, IF(WEEKDAY([Start Date]9) = 2, [Start Date]9 + 6, IF(WEEKDAY([Start Date]9) = 3, [Start Date]9 + 5, IF(WEEKDAY([Start Date]9) = 4, [Start Date]9 + 4, IF(WEEKDAY([Start Date]9) = 5, [Start Date]9 + 3, IF(WEEKDAY([Start Date]9) = 6, [Start Date]9 + 2, IF(WEEKDAY([Start Date]9) = 7, [Start Date]9 + 1)))))))
Make sure to change [Start Date]9 in the formula above to reference a cell in your own sheet.
-
J. Craig Williams ✭✭✭✭✭✭
jgomeztagle
Try this:
=IF(WEEKDAY([Date]23) = 1, [Date]23, (8 - WEEKDAY([Date]23)) + [Date]23)
If the [Date]23 is Sunday, it will return that date, otherwise it will return the upcoming Sunday.
The formula is very close to Excel's.
Craig
-
Ky|e ✭
Hello,
I am trying to return the Friday after the set date. I tried to tinker with the formula and the closest I could get is as follows:
=IF(WEEKDAY([Due Date]$1) = 7, [Due Date]$1, (6 - WEEKDAY([Due Date]$1)) + [Due Date]$1)
The only day which I see a problem with is Saturday, which will pull the same day of Saturday. Would you happen to know how I could adjust this so that the Saturday (take for instance 4/13/19, will populate a date of the upcoming Friday 4/19/19?
Appreciate your help with this.
Thank you,
Categories
Please use the formula I provided. It was intentional for the character \"~\" to be included. <\/p>
=MID(Name@row, FIND(\"~\", SUBSTITUTE(Name@row, \"-\", \"~\", 5)) + 1, FIND(\"~\", SUBSTITUTE(Name@row, \"-\", \"~\", 6)) - 1 - FIND(\"~\", SUBSTITUTE(Name@row, \"-\", \"~\", 5)))<\/p>
Kelly<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":106552,"type":"question","name":"Problem w\/Index - Match formula","excerpt":"I using the following formula, =INDEX({Contract Focal Point}, MATCH([Contract No.]@row, {Contract No.}), 0) And it works for the first row when i input in the contract number into the column. On subsequent rows when i input the contract number it pulls back incorrect information and if I put in a fictious number it pulls…","categoryID":322,"dateInserted":"2023-06-16T15:13:32+00:00","dateUpdated":null,"dateLastComment":"2023-06-16T15:36:24+00:00","insertUserID":162467,"insertUser":{"userID":162467,"name":"Ed Smartsheet","title":"Mr","url":"https:\/\/community.smartsheet.com\/profile\/Ed%20Smartsheet","photoUrl":"https:\/\/lh3.googleusercontent.com\/a\/AATXAJyYOjKt3k3tneIFbUPuoJzZbnd9quLS-Wdt5b7l=s96-c","dateLastActive":"2023-06-16T19:45:18+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":91566,"lastUser":{"userID":91566,"name":"Genevieve P.","title":"Community Manager","url":"https:\/\/community.smartsheet.com\/profile\/Genevieve%20P.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/KHY4Y67W0VRX\/nF76D5N9MFB28.png","dateLastActive":"2023-06-16T17:50:53+00:00","banned":0,"punished":0,"private":false,"label":"Employee Admin"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":32,"score":null,"hot":3373859396,"url":"https:\/\/community.smartsheet.com\/discussion\/106552\/problem-w-index-match-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106552\/problem-w-index-match-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106552,"commentID":381031,"name":"Re: Problem w\/Index - Match formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/381031#Comment_381031","dateInserted":"2023-06-16T15:36:24+00:00","insertUserID":91566,"insertUser":{"userID":91566,"name":"Genevieve P.","title":"Community Manager","url":"https:\/\/community.smartsheet.com\/profile\/Genevieve%20P.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/KHY4Y67W0VRX\/nF76D5N9MFB28.png","dateLastActive":"2023-06-16T17:50:53+00:00","banned":0,"punished":0,"private":false,"label":"Employee Admin"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-16T19:45:15+00:00","dateAnswered":"2023-06-16T15:36:24+00:00","acceptedAnswers":[{"commentID":381031,"body":"
=INDEX({Contract Focal Point}, MATCH([Contract No.]@row, {Contract No.}, 0))<\/strong><\/p>