=SUM - Military Time conditional calculation Formula
Need help with calculation of military time:
I have two columns that I am using to track Admission time and Discharged time to determine and average length of stay.
I am using military time for each column and storing the difference in a third column for each row
=SUM(([Discharge Time From ER]2 - [Admit Time]2) / 100)
Exp DC time 300 – Ad time 100 = 2 hrs
However I was notified that we will be keeping track of admission times and discharge times that span past midnight (2400).
So I will have the Scenario where my admission time is 2300 hrs and my discharge time is 0200 hrs
Which with the above calculation will give me a negative number and hose up my averages
So can someone assist in providing a formula where if my calculation is negative to add 24 to the negative number otherwise if positive leave the value alone?
I am not that experienced with Smartsheet formulas and conditionals and could use the help.
I have provided a snapshot below.
Thank you in advance for your help!
Comments
-
bday2329 ✭✭✭✭
sorry attached a picture of example
-
Brian W ✭✭
Basically, the formula you are requesting would be this:
=IF(SUM(([Discharge Time]@row- [Admit Time]@row)/ 100) < 0, SUM(([Discharge Time]@row- [Admit Time]@row)/ 100) + 24, SUM(([Discharge Time]@row- [Admit Time]@row)/ 100))
This should calculate correctly as long as all the stays are less than 24 hours and in one hour increments, e.g. not 0830, 1215, etc.
-
bday2329 ✭✭✭✭
Thank you for your help, it works perfectly, I appreciate your skill and time!
Help Article Resources
Categories
=INDEX({Data SHPType}, MATCH(Course@row, {Data Course}, 0<\/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":106455,"type":"question","name":"Formula to count items in a cell separated by a semicolon","excerpt":"Good afternoon, could someone help me with a formula to count items in a cell separated by a semicolon and put the total in another? I have a column called: \"MRA Actives codes\", in which there are different medical codes separated by a semicolon, for example: I70.0: Atherosclerosis of aorta; I50.9: Heart failure…","categoryID":322,"dateInserted":"2023-06-14T19:20:24+00:00","dateUpdated":null,"dateLastComment":"2023-06-15T11:46:15+00:00","insertUserID":162381,"insertUser":{"userID":162381,"name":"VirginiaLazor","title":"Medical Risk Adjustment Auditor","url":"https:\/\/community.smartsheet.com\/profile\/VirginiaLazor","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!b1Dom3_UQfo!xekpcXON8bo!9w33zAjZR8S","dateLastActive":"2023-06-15T12:10:22+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-06-15T12:16:06+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":6,"countViews":39,"score":null,"hot":3373603599,"url":"https:\/\/community.smartsheet.com\/discussion\/106455\/formula-to-count-items-in-a-cell-separated-by-a-semicolon","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106455\/formula-to-count-items-in-a-cell-separated-by-a-semicolon","format":"Rich","lastPost":{"discussionID":106455,"commentID":380725,"name":"Re: Formula to count items in a cell separated by a semicolon","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/380725#Comment_380725","dateInserted":"2023-06-15T11:46:15+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-06-15T12:16:06+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"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-15T12:03:29+00:00","dateAnswered":"2023-06-15T11:44:52+00:00","acceptedAnswers":[{"commentID":380724,"body":"