Easiest solution I have for (time)-(time)=duration
I always look here for solutions to my ideas before I spend too much time on them. I was not able to find a simple solution for doing calculations with time. Honestly, after my initial search, I ended up exporting to excel to do the math, then importing back in.
Long story short, here is a single formula to subtract start time from end time and provide a duration. Times are HH:MM 24 hour format. Works great for tracking time spent on different projects via a mobile form.
Snip with formula and column names for reference: https://ibb.co/dBYrDGJ
Formula for copy paste:
=(IF((VALUE(RIGHT([End time]@row, 2)) - VALUE(RIGHT([Start Time]@row, 2))) > 0, (VALUE(LEFT([End time]@row, 2)) - VALUE(LEFT([Start Time]@row, 2))), (VALUE(LEFT([End time]@row, 2)) - VALUE(LEFT([Start Time]@row, 2))) - 1)) + ":" + (IF((VALUE(RIGHT([End time]@row, 2)) - VALUE(RIGHT([Start Time]@row, 2))) < 0, 60 + (VALUE(RIGHT([End time]@row, 2)) - VALUE(RIGHT([Start Time]@row, 2))), (VALUE(RIGHT([End time]@row, 2)) - VALUE(RIGHT([Start Time]@row, 2)))))
Answers
-
Here is a link to a number of time based solutions that you may want to check out if you ever have any other bits you need to solve for:
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.1K Get Help
- 380 Global Discussions
- 212 Industry Talk
- 442 Announcements
- 4.6K Ideas & Feature Requests
- 140 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 450 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 289 Events
- 34 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!