Issue Sorting by Time

As many are aware, the "sort by time" function is not (yet) available in SmartSheet as it is in Excel. Essentially SmartSheet treats time sequentially as opposed to recognizing AM/PM. So sorting a time field would, for instance, show 8:10 AM followed by 8:15 PM and so on. There has been some suggestions posted in terms of using military time or having separate AM/PM columns, but for me this isn't the best solution. Additionally, there have been several postings that suggest a work around of creating a formula in a new column, sorting by that column, and then hiding that column. In that light, I tried using one of the suggested formulas as shown below:


=((VALUE(LEFT(Time1, FIND(":", Time1) - 1)) + (COUNTIF(Time1, FIND("pm",@cell)<> 0) * 12)) * 60) + VALUE(MID(Time1, FIND(":", Time1) + 1, 2))


This formula works well except for instances containing 12PM. Essentially, when sorting, this falls after 11 PM when it should be before 1PM. On a different post I found the following that accounts for this:


IF(VALUE(LEFT(Time7, FIND(":", Time7) - 1)) = 12, 0, (VALUE(LEFT(Time7, FIND(":", Time7) - 1))))


The post states that if the hour is 12, pretend it is zero so that both 12 am and 12 pm will come before 1 am and 1 respectively.


My thought is to combine these functions somehow, but I have not been successful. Any help with this (or other suggestions) is greatly appreciated.


Credit for these formulas goes toAdam Overton.


Thank you

Best Answer

Answers

  • Richard Rymill SBP
    Richard Rymill SBP ✭✭✭✭✭✭

    Michael I believe we have the answer ready built for you Using the API and what we call "Cell level Timestamp manager" which can record date & time down to minutes from which you can then create formulas to use this data. We would need to test it against your use case but i think we are on the right track?

    I've attached an explainer sheet as it is part of a list of API solutions we have written.

    (电子邮件保护)


  • Paul,


    This works perfectly for what I need. I really do appreciate you taking the time to create this formula and I'm certain this helps many others on the SS forum as well.


    All the best and thank you!

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    @Michael Shubeck

    Happy to help!


    Please don't forget to mark the most appropriate response(s) as "helpful" so that others looking for a similar solution can know that one may be found here.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the公式手册模板!
You have an extra comma in your formula before the close parenthesis for the AND<\/p>
\n
\n \n \"example.png\"<\/img><\/a>\n <\/div>\n<\/div>\n

Once you remove that, you should be set!<\/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":110956,"type":"question","name":"Formula IFS return values from other columns","excerpt":"Hi, i am trying to set a new column that should return EAS or ETS text depending of what it is in column named \"ETS\", but i want to add another if that return a value from column \"Business Dropdown\" if the column ETS is blank. This is the formula that i wrote now very simple and it is running well, but it is missing the…","snippet":"Hi, i am trying to set a new column that should return EAS or ETS text depending of what it is in column named \"ETS\", but i want to add another if that return a value from column…","categoryID":322,"dateInserted":"2023-09-28T20:10:28+00:00","dateUpdated":null,"dateLastComment":"2023-09-28T20:35:00+00:00","insertUserID":140104,"insertUser":{"userID":140104,"name":"Raul Cabrera","url":"https:\/\/community.smartsheet.com\/profile\/Raul%20Cabrera","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!WxHVX93-X34!CelZAvGm7jw!7qwcGhKSeo9","dateLastActive":"2023-09-28T20:50:50+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":165153,"lastUser":{"userID":165153,"name":"DKazatsky2","url":"https:\/\/community.smartsheet.com\/profile\/DKazatsky2","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T20:51:34+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":1,"countViews":19,"score":null,"hot":3391865728,"url":"https:\/\/community.smartsheet.com\/discussion\/110956\/formula-ifs-return-values-from-other-columns","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/110956\/formula-ifs-return-values-from-other-columns","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":110956,"commentID":397531,"name":"Re: Formula IFS return values from other columns","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/397531#Comment_397531","dateInserted":"2023-09-28T20:35:00+00:00","insertUserID":165153,"insertUser":{"userID":165153,"name":"DKazatsky2","url":"https:\/\/community.smartsheet.com\/profile\/DKazatsky2","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T20:51:34+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\/ASKPITW4DU25\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-09-28T20:50:48+00:00","dateAnswered":"2023-09-28T20:35:00+00:00","acceptedAnswers":[{"commentID":397531,"body":"

Hi @Raul Cabrera<\/a> ,<\/p>

Give this try.<\/p>

=IF(ETS@row = \"//www.santa-greenland.com/community/discussion/65991/\", [Business_Dropdown]@row, IF(ETS@row = \"EAS\", \"EAS\", IF(ETS@row = \"ETS\", \"ETS\")))<\/p>

Hope this helps,<\/p>

Dave<\/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":254,"urlcode":"formulas","name":"Formulas"}]},{"discussionID":110951,"type":"question","name":"Formula Help For Multiple Tags Within The Same Cell","excerpt":"Hey All! First time posting... so here goes... I am attempting to write a formula that references another sheet, looks at a specific column, and then 'finds and counts' all the instances of a specific tag. For example, the intake form allows multiple 'characteristics' to be chosen when describing a call. These…","snippet":"Hey All! First time posting... so here goes... I am attempting to write a formula that references another sheet, looks at a specific column, and then 'finds and counts' all the…","categoryID":322,"dateInserted":"2023-09-28T19:18:37+00:00","dateUpdated":null,"dateLastComment":"2023-09-28T20:04:52+00:00","insertUserID":166984,"insertUser":{"userID":166984,"name":"EmRo","title":"Senior Operations Business Analyst","url":"https:\/\/community.smartsheet.com\/profile\/EmRo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T20:00:35+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":166984,"lastUser":{"userID":166984,"name":"EmRo","title":"Senior Operations Business Analyst","url":"https:\/\/community.smartsheet.com\/profile\/EmRo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T20:00:35+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":22,"score":null,"hot":3391862009,"url":"https:\/\/community.smartsheet.com\/discussion\/110951\/formula-help-for-multiple-tags-within-the-same-cell","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/110951\/formula-help-for-multiple-tags-within-the-same-cell","format":"Rich","lastPost":{"discussionID":110951,"commentID":397526,"name":"Re: Formula Help For Multiple Tags Within The Same Cell","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/397526#Comment_397526","dateInserted":"2023-09-28T20:04:52+00:00","insertUserID":166984,"insertUser":{"userID":166984,"name":"EmRo","title":"Senior Operations Business Analyst","url":"https:\/\/community.smartsheet.com\/profile\/EmRo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T20:00:35+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\/44ABE1FHZKC6\/call-categories-dashboard-image-2023-09-28.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Call Categories Dashboard_Image_2023-09-28.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-09-28T20:03:55+00:00","dateAnswered":"2023-09-28T19:57:29+00:00","acceptedAnswers":[{"commentID":397521,"body":"

Hi @EmRo<\/a> ,<\/p>

Trying using the HAS() function in your formula.<\/p>

=COUNTIF({Client Business Sim LIVE Call Characteristic}, HAS(@cell, Description@row))<\/p>

Hope this helps,<\/p>

Dave<\/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":[]}],"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