Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
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.