Discussions
NSC | Formula to Calculate Total Time in Minutes
Scenario
There are Time of Day type custom fields for "Time Started" and "Time Finished".
User wants to automatically calculate the total time (in minutes) between these two fields and show it in another custom field "Time Spent".
For example:
- Time Started = 1:00 pm
- Time Finished = 2:30pm
The Time Spent field should show 90.
Solution
This formula can be used to calculate the total time in minutes:
((CASE WHEN (FLOOR(({fieldforendtime}-{fieldforstarttime})*24)) < 0 THEN FLOOR(({fieldforendtime}-{fieldforstarttime})*24)+24 ELSE (FLOOR(({fieldforendtime}-{fieldforstarttime})*24)) END)*60) + (CASE WHEN MOD((({fieldforendtime}-{fieldforstarttime})*1440), 60) < 0 THEN MOD((({fieldforendtime}-{fieldforstarttime})*1440), 60)+60 ELSE MOD((({fieldforendtime}-{fieldforstarttime})*1440), 60) END)
Just change the {fieldforendtime} and {fieldforstarttime} to the field IDs of the fields in your account.
Learn how to Refer A Member | Earn the Answer Accepter Badge | Be the Content Creator of the Quarter | Vote for the content you want to see!