### Title

Adding and Subtracting Time

### Post

I am completely new to FMP, but have quite a bit of experience with Excel and Numbers, so am not complete new to writting formulas.

I am trying to create a simple Timeclock. I have created four fields which will gather Current Time, when a coordsponding button is pressed:

Clock in, Lunch in, Lunch out, Clock out.

I have created another field which will acumulate the total time worked in a day. I have been playing around with how to get this field's equations to funciton properly.

I have read through many of the other forum posts on how to make this work, and have spent a couple of hours reading through the functions refference, and cannot seem to make them function properly. All of the results it is yielding make no sense.

I have tried: MOD ( Lunch in - Clock in + 86400 , 86400) as suggested on this forum:

I'm at a loss, this seems like it should not be difficult.

Thank you for your help

It updates for me each time I exit a field by tabbing into the next field. It stays up to date, but treats empty fields as zero so I get negative values whenever a person clocks in and hasn't yet clocked back out...

You could modify this calculation to be:

( If ( Lunch out ; Lunch out - Clock in ) + If ( Clock Out ; Clock Out - Lunch in ) ) / 3600

Then you won't get negative values.

And you may want to consider using two records with an in and out date stamp field in place of one record with these four fields. That allows more easily for situations where a person works for part of a day and then leaves instead of taking a lunch break. A Summary field can total up the hours for any given day in order to get a daily total.

Using date stamps in place of time insures correct results even when some one works past midnight.