Calculate Week number from multiple choice dates column

Hi,

We are running a Wellness challenge for a charity. Participants log the days and duration when they performed the activity.

We allow selecting multiple dates for the same activity.

I try to total Duration for a week. "Duration" mean the number of hours for each of the selected days.

First, I need to convert a date into a Week. How can I do it considering that dates are in a multi-select column?

image.png

Thanks in advance.

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    If you just need to multiply the duration by the number of dates selected then you could use something like this:

    =[Duration (Hours)]@row * COUNTM([Dates Completed]@row)

  • Hi Paul,

    Thank you! It will allow us to calculate the total hours.

    But we have another problem: I would like to calculate how many hours Per Week each participant accumulated. I need to convert each date into a Week and then total the hours per person.

    How can I extract individual dates from the Multiple Select column?

    Then, I can just total hours per week per person.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Extracting the dates can be a little burdensome. To start, you will need a date type column for as many possible dates as will be selected for a single entry. So if someone can select no more than 10 dates, you will need 10 additional columns. Then we would need to put together a rather complex formula to parse out the selections and then convert them into actual dates. It is possible, but it is a fair amount of work. I'd be happy to help with the formulas if you are wanting to go down that route.


    The absolute easiest way to solve both problems... Have the users fill out a single form for each date/entry instead of lumping a bunch of text values that look like dates together and then trying to parse them out.

  • Hi Paul,

    We decided to allow users to enter multiple dates in a Sheet instead of a Form for two customer service reasons:

    1. Users can do it once per week and report multiple daily activities on one line instead of filling the Form seven times.
    2. Users can see how many other people are doing it and it will motivate them to do it too.

    I like the idea of creating seven columns. One for each day. And then extracting each day from multi-select into each of the columns.

    If someone enters more than seven days, I will manually split it into two records with seven or fewer entries.

    How can we write a formula to extract days into a separate columns?


    TIA

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the公式手册模板!
You would use something along the lines of (Jan 2023):<\/p>

=COUNTIFS({Date Column}, AND(IFERROR(MONTH(@cell), 0) = 1<\/strong>, IFERROR(YEAR(@cell), 0) = 2023<\/strong>))<\/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":108911,"type":"question","name":"IF formula not working for a drop down list","excerpt":"Hello, I'm trying to equate a numerical value to a drop down list when I receive a form entry. Here is my list: 4 - very clear 3 - clear 2 - somewhat clear 1 - not clear The formula I entered was =IF([Training Objectives]@row = \"1 - not clear\", 1, IF([Training Objectives]@row = \"2 - somewhat clear\", 2, IF([Training…","snippet":"Hello, I'm trying to equate a numerical value to a drop down list when I receive a form entry. Here is my list: 4 - very clear 3 - clear 2 - somewhat clear 1 - not clear The…","categoryID":322,"dateInserted":"2023-08-14T14:32:56+00:00","dateUpdated":null,"dateLastComment":"2023-08-14T15:02:24+00:00","insertUserID":143464,"insertUser":{"userID":143464,"name":"Courtney M","url":"https:\/\/community.smartsheet.com\/profile\/Courtney%20M","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!ZMErGR_kbWs!zDErcze5yPs!34pFnjKNrYv","dateLastActive":"2023-08-14T14:58:23+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":151203,"lastUser":{"userID":151203,"name":"Nick Korna","url":"https:\/\/community.smartsheet.com\/profile\/Nick%20Korna","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-14T16:26:14+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":33,"score":null,"hot":3384050720,"url":"https:\/\/community.smartsheet.com\/discussion\/108911\/if-formula-not-working-for-a-drop-down-list","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108911\/if-formula-not-working-for-a-drop-down-list","format":"Rich","lastPost":{"discussionID":108911,"commentID":390469,"name":"Re: IF formula not working for a drop down list","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/390469#Comment_390469","dateInserted":"2023-08-14T15:02:24+00:00","insertUserID":151203,"insertUser":{"userID":151203,"name":"Nick Korna","url":"https:\/\/community.smartsheet.com\/profile\/Nick%20Korna","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-14T16:26:14+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-14T15:25:45+00:00","dateAnswered":"2023-08-14T14:38:51+00:00","acceptedAnswers":[{"commentID":390454,"body":"

Hi @Courtney M<\/a>,<\/p>

It's an easy fix - you have an extra comma and bracket at the end of your formula. It should be:<\/p>

=IF([Training Objectives]@row = \"1 - not clear\", 1, IF([Training Objectives]@row = \"2 - somewhat clear\", 2, IF([Training Objectives]@row = \"3 - clear\", 3, IF([Training Objectives]@row = \"4 - very clear\", 4))))<\/p>

Hope this helps!<\/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":108901,"type":"question","name":"Unique codes","excerpt":"Hey all, I am trying to create a system that will check a unique code that is entered through a form and display if this code has been used already or not. I have a formula in the summary sheet that will asses if the code has been used or not: =VLOOKUP($Code$1, {Z Codes Trial Database Range 1}, 3, 0) The problem is that I…","snippet":"Hey all, I am trying to create a system that will check a unique code that is entered through a form and display if this code has been used already or not. I have a formula in the…","categoryID":322,"dateInserted":"2023-08-14T09:42:01+00:00","dateUpdated":null,"dateLastComment":"2023-08-14T14:37:37+00:00","insertUserID":160845,"insertUser":{"userID":160845,"name":"Itai","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Itai","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/3K032BZUIDXO\/nIVF32ENJD2KA.jpeg","dateLastActive":"2023-08-14T16:02:53+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"},"updateUserID":null,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-08-14T16:26:18+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":5,"countViews":46,"score":null,"hot":3384032978,"url":"https:\/\/community.smartsheet.com\/discussion\/108901\/unique-codes","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108901\/unique-codes","format":"Rich","tagIDs":[204,254],"lastPost":{"discussionID":108901,"commentID":390453,"name":"Re: Unique codes","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/390453#Comment_390453","dateInserted":"2023-08-14T14:37:37+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-08-14T16:26:18+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/RGMU4LB8MFBS\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-14T12:23:27+00:00","dateAnswered":"2023-08-14T11:59:02+00:00","acceptedAnswers":[{"commentID":390433,"body":"

Try nesting in an INDEX function with a specified row of 1.<\/p>

=VLOOKUP(INDEX(Code:Code, 1)<\/strong>, {Cross Sheet Reference}, .......)<\/p>"},{"commentID":390435,"body":"

Try using INDEX(Code:Code, 1) instead of $Code$1<\/p>

Note: Also, I would recommend you use INDEX\/MATCH instead of VLOOKUP. Much more reliable.<\/p>


<\/p>

I hope this helps you.<\/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":[{"tagID":204,"urlcode":"Forms","name":"Forms"},{"tagID":254,"urlcode":"Formulas","name":"Formulas"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=322&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending in Formulas and Functions