Action based on System-Generated Modified Date/Time
Is there a forumla I can create that will check a box based on the auto-generated timestamp?
Screenshot:
I am looking to check the AM/PM box based on entry time (anything before 12PM would check the AM box and anything after 12PM would check the PM box).
Best Answers
-
Paul Newcome ✭✭✭✭✭✭
What do you mean by "it did not work"? Are you getting an error or unexpected results?
Let's try something different...
=IF(FIND("A", Modified@row) > 0, 1)
=IF(FIND("P", Modified@row) > 0, 1)
-
Paul Newcome ✭✭✭✭✭✭
Ah. Those were for converting the times for a display. The solution you are gong to want involves using an IF statement to determine if it is pm and then a MID statement to simply look at the hour. We pull the date into another date type column and use the IF to say that if it meets the criteria, add or subtract one day depending on your specific needs. It is not nearly as complicated as time manipulation. Your formula in a single date type column is going to look something along the lines of...
=DATEONLY([Created (Date)]@row) - IF(AND(PM@row = 1, VALUE(MID([Created (Date)]@row, 10, FIND(":", [Created (Date)]@row) - 10)) >= 5), 1)
Since we already have the PM column, we just use that to check for that, and then we use this part:
VALUE(MID([Created (Date)]@row, 10, FIND(":", [Created (Date)]@row) - 10))
to pull the hour and convert it to a numerical value. If that number is greater than or equal to 5, we subtract a day from the incorrect date that is being pulled by the DATEONLY function.
Then you would use this helper column instead of the created column in your COUNTIFS.
Answers
-
Paul Newcome ✭✭✭✭✭✭
Try...
=CONTAINS("A”,修改@row)
and
=CONTAINS("P”,修改@row)
-
@SPark ✭✭✭
Hi@Paul Newcome!!
It unfortunately did not work.. the system generated columns always give me grief.
-
Paul Newcome ✭✭✭✭✭✭
What do you mean by "it did not work"? Are you getting an error or unexpected results?
Let's try something different...
=IF(FIND("A", Modified@row) > 0, 1)
=IF(FIND("P", Modified@row) > 0, 1)
-
@SPark ✭✭✭
The =CONTAINS("A”,修改@row) forumla did not give me an error, however, it also did not give me any results (i.e., the box did not check).
The 2nd formula =IF(FIND("A", Modified@row) > 0, 1) did work!!
@Paul Newcomeyou're my smartsheet hero.
-
@SPark ✭✭✭
@Paul Newcomeif you have time would you be able to explain to me why the 2nd would work and the 1st would not produce the same outcome? I tried a couple myself before posting on the community and I couldn't figure it out-- but I was only doing versions of IF. Any insight is appreciated!!
-
Paul Newcome ✭✭✭✭✭✭
Honestly I am not exactly sure why. The CONTAINS function produces a true/false result. As a standalone you can normally use it as above to check a box based on whether or not specific text is found in a cell (or range of cells).
For example...
I am not sure why the CONTAINS didn't work because I have used it in the past looking for "a" vs "p" in Time Calculations but it was within a larger formula.
I also tested nesting the CONTAINS in an IF to test that, but that didn't work either.
The FIND function seems to have picked it up though.
I can't tell you exactly why one worked and the other didn't though. I just hope I don't have to go through and redo all of my time related formulas to remove the CONTAINS function. They WERE previously working...
-
@SPark ✭✭✭
I have no idea what I am missing but any ideas/thoughts would be appreciated!!
My goal is to pull a report that shows today's entries. Sheet B (below) is marking AM/PM based on the help@Paul Newcomegave me in the above comments-- and then Sheet A is counting the AMs and PMs based on the formula below. The issue is Sheet A is still counting entries from yesterday and I'm not sure what I'm missing. I also have this threadhttps://community.smartsheet.com/discussion/68964/count-if-on-system-generated-column#latestwhere I adjusted the working hours/days to 24/7.
(Sheet A)
The Formula for this is:=COUNTIFS({Store}, Store@row, {Created}, TODAY(), {PM_}, 1)
Which is pulling from this sheet: (Sheet B)
Where the formula reads:=IF(FIND("P", [Created (Date)]@row) > 0, 1)
-
@SPark ✭✭✭
ALSO- when I apply a filter with the condition as created date as today-- it shows those two entries from last night. So it's something with the system generated date. (I think?)
-
Paul Newcome ✭✭✭✭✭✭
It may be a timezone thing. I have seen this a few times recently here in the community. Are you able to pinpoint which hour the sheet starts pulling for "today"? Is it anything after 6pm, or 7pm, etc?
-
@SPark ✭✭✭
@Paul NewcomeIt looks like 5PM from the day prior.
-
Paul Newcome ✭✭✭✭✭✭
Ok. Let me dig through my notes and past comments here in the Community. I will try to find the solution we used before for this same thing.
-
@SPark ✭✭✭
I was able to find some threads on this but the work arounds seemed really complicated.. added columns with hours, minutes, etc. and extremely long formulas..
If that's the case@Paul Newcomeno need to dig through your notes! I can make due by updating manually. I appreciate your help and insight as always.
-
Paul Newcome ✭✭✭✭✭✭
Ah. Those were for converting the times for a display. The solution you are gong to want involves using an IF statement to determine if it is pm and then a MID statement to simply look at the hour. We pull the date into another date type column and use the IF to say that if it meets the criteria, add or subtract one day depending on your specific needs. It is not nearly as complicated as time manipulation. Your formula in a single date type column is going to look something along the lines of...
=DATEONLY([Created (Date)]@row) - IF(AND(PM@row = 1, VALUE(MID([Created (Date)]@row, 10, FIND(":", [Created (Date)]@row) - 10)) >= 5), 1)
Since we already have the PM column, we just use that to check for that, and then we use this part:
VALUE(MID([Created (Date)]@row, 10, FIND(":", [Created (Date)]@row) - 10))
to pull the hour and convert it to a numerical value. If that number is greater than or equal to 5, we subtract a day from the incorrect date that is being pulled by the DATEONLY function.
Then you would use this helper column instead of the created column in your COUNTIFS.
-
@SPark ✭✭✭
@Paul Newcomeyup, that did it! MUCH appreciated, you are a smartsheet ninja.
-
Paul Newcome ✭✭✭✭✭✭
Help Article Resources
Categories
Check out theFormula Handbook template!
Instead of applying the formula to \"Multiselect Text String\" row, did you tried with \"Multiselect Values\" row?<\/p>
=IF(HAS([Multiselect Values]@row, [Component ID]@row), \"MATCH\", \"NO MATCH\")<\/p>
Thank 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":[]},{"discussionID":109493,"type":"question","name":"I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","excerpt":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5 different statuses in a separate column. So using the screenshot I've provided as an example (although it doesn't have 5 different statuses in the…","snippet":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5…","categoryID":322,"dateInserted":"2023-08-25T20:03:21+00:00","dateUpdated":null,"dateLastComment":"2023-08-26T00:34:49+00:00","insertUserID":165710,"insertUser":{"userID":165710,"name":"SmarsheetNewb","url":"https:\/\/community.smartsheet.com\/profile\/SmarsheetNewb","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-26T00:33:27+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":161714,"lastUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-27T02:16:35+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":26,"score":null,"hot":3386005690,"url":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109493,"commentID":392692,"name":"Re: I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392692#Comment_392692","dateInserted":"2023-08-26T00:34:49+00:00","insertUserID":161714,"insertUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-27T02:16: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,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-26T00:33:25+00:00","dateAnswered":"2023-08-25T20:44:12+00:00","acceptedAnswers":[{"commentID":392662,"body":"
Try this:<\/p>
=COUNTIFS([Item Number]:[Item Number], OR(@cell = \"C001\", @cell = \"COO2\", @cell = \"COO3\", @cell = \"COO4\"), [Status]:[Status], OR(@cell = \"Green\", @cell = \"Yellow\", @cell = \"Red\"))<\/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":109474,"type":"question","name":"Help with date calculation formula","excerpt":"Hello, I'm trying to find a formula that will help me calculate how long an intake took to resolve. The rows I need to be calculated are Date Reported & Resolution Date. If the resolution date is blank I want it to use the current date in the calculation to see how long this issue has gone unresolved. Any help is much…","snippet":"Hello, I'm trying to find a formula that will help me calculate how long an intake took to resolve. The rows I need to be calculated are Date Reported & Resolution Date. If the…","categoryID":322,"dateInserted":"2023-08-25T16:29:39+00:00","dateUpdated":"2023-08-25T16:29:59+00:00","dateLastComment":"2023-08-25T23:01:30+00:00","insertUserID":165688,"insertUser":{"userID":165688,"name":"Nwest","title":"Systems Analyst","url":"https:\/\/community.smartsheet.com\/profile\/Nwest","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!ukHVZ18ImX4!BcjWAe8S9SY!l7iQo_PZHOx","dateLastActive":"2023-08-25T17:22:30+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":165688,"lastUserID":8888,"lastUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-08-26T17:06:33+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":25,"score":null,"hot":3385987269,"url":"https:\/\/community.smartsheet.com\/discussion\/109474\/help-with-date-calculation-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109474\/help-with-date-calculation-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109474,"commentID":392687,"name":"Re: Help with date calculation formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392687#Comment_392687","dateInserted":"2023-08-25T23:01:30+00:00","insertUserID":8888,"insertUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-08-26T17:06:33+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-25T17:04:22+00:00","dateAnswered":"2023-08-25T16:36:59+00:00","acceptedAnswers":[{"commentID":392622,"body":"