HowTo: Multiply duration (time) with numeric value

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
peter_b
Chatterbox
Posts: 338
Joined: Tue Nov 12, 2013 2:05 am

HowTo: Multiply duration (time) with numeric value

Post by peter_b »

This HowTo describes how to multiply a duration (formatted and input as time: hh:mm:ss) with a numeric value.
For example, to calculate the sum to charge for a duration, depending how much it costs per hour:

Code: Select all

A1(start_time):     hh:mm:ss
B1(end_time):       hh:mm:ss
C1(duration):       =B1-A1
D1(price_per_hour): 140
E1(sum):            =C1*24*D1
This should represent line 1 in a table, and what to put into each cell.
The trick to multiply with a time duration is, to multiply it by 24 - to get the value in hours.
If you want minutes, multiply the duration by 24, then by 60:

Code: Select all

F1(minutes): =C1*24*60
Post Reply