Skip to main content
joshuab76782683
Participating Frequently
March 25, 2019
Question

Function for timesheet calculation

  • March 25, 2019
  • 1 reply
  • 953 views

Hi Guys,

I wanted to know, Is it possible to create a Javascript Function based calculation for a timesheet that also includes amount of people working during that time period.

Example.

StartFinishNumber of workersTotal Hours
Start1.0Finish1.0Workers1.0Totalhours1.0
Start1.1Finish1.1Workers1.1Totalhours1.1
Start1.2Finish1.1Workers1.2Totalhours1.2

My function would be something like CalcHours() …..   which would yield something like would calculate like this (Finish1.0 - Start1.0) * Workers1.0

your helps would be greatly appreciated.

This topic has been closed for replies.

1 reply

rayek.elfin
Legend
March 27, 2019

Is there a particular reason to use a Javascript function for this simple calculation? Otherwise just use a Simplified Notation calculation field for your total hours field with this formula:

((finishTime - startTime)*numberOfWorkers)

try67
Community Expert
Community Expert
March 27, 2019

The reason is it won't work that way... Time calculations require using a script.

joshuab76782683
Participating Frequently
March 27, 2019

TRy67, do you think you would know how to solve this? you seem like you know your stuff.

Many people would appreciate it.