Connecting Tech Pros Worldwide Forums | Help | Site Map

Help calculating Time from Fee and Hourly Rate

Newbie
 
Join Date: Aug 2008
Posts: 14
#1: Jan 10 '09
Thank you in advance for your help.

I'm trying to calculate the Total Time in hours and minutes to complete a job. The way we are calculating it is by taking the Fee paid and dividing that by a 1:00.

In Excel - Marsh is charged $90.00 (This is pre-determined)
Her job is a $25.00/hour job (This is pre-determined)
The Raw Hours to complete the job is 3.6 hours (I have this already in
a qry)
the Total Time to complete the job is 3:36. (Can't figure out how to get
this.

missinglinq's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,000
#2: Jan 10 '09

re: Help calculating Time from Fee and Hourly Rate


Expand|Select|Wrap|Line Numbers
  1. Me.TotalTime = (Me.RawHours * 60) \ 60 & ":" & (Me.RawHours * 60) Mod 60
Not that I used the Backslash in the first half of the expression. The Backslash only returns the Integer portion of the division, the 3 in your example.

Linq ;0)>
Moderator
 
Join Date: Feb 2008
Location: Beauly, near Inverness, Scotland
Posts: 1,576
#3: Jan 10 '09

re: Help calculating Time from Fee and Hourly Rate


Hi. The 3.6 is the time in hours expressed as a decimal value. It is derived as the ratio of the fee paid to the hourly rate:

3.6 = 90 / 25, generalised to

[Time in Hours Decimal] = [Fee Paid] / [Hourly Rate]

The 3:36 you mention is the time expressed in hours and minutes:
3.6 hours converted to hours and minutes =
3.6 * 60 minutes = 216 minutes = 3 hours and 36 minutes.

As the times you are referring to are not clock times - it is simply a total for hours:minutes, not a time of day - I would suggest that it is best to work in total minutes if you have any further calculations, or separately in hours and minutes if you don't, then combine back to hours and minutes for final presentation if need be.

The calculations are as follows.

If working in total minutes (should you need to do any other calculations such as adding the total hours from different jobs):

[Total Minutes] = [Time in Hours Decimal] * 60
[Hours] = Int([Total Minutes]/60)
[Minutes] = [Total Minutes] - (Int([Total Minutes]/60)*60)

If you do not have other values you need to add on the calculations are even simpler:

[Hours] = Int([Time in Hours Decimal])
[Minutes] = ([Time in Hours Decimal] - Int([Time in Hours Decimal]))*60

For presentation as hours:minutes on a report or somesuch, you can simply combine the hours and minutes values as follows:

[Time in Hours:Minutes] = [Hours] & ":" & [Minutes]

-Stewart

ps but Linq's equivalent solution is much simpler!!
Newbie
 
Join Date: Aug 2008
Posts: 14
#4: Jan 10 '09

re: Help calculating Time from Fee and Hourly Rate


Thank you both for your help!
missinglinq's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,000
#5: Jan 11 '09

re: Help calculating Time from Fee and Hourly Rate


Glad we could help!

Linq ;0)>
Reply


Similar Microsoft Access / VBA bytes