Calculate the hours between two times

D

daisy

I'm trying to find a formula that will calculate the number of hours between
the time I start work and finish work.
I have one column (A2) that says 7:30am and one Colum (A3) that says 7:30pm.
Does anyone know how to help me?
 
S

Sarah0824

You could use military time. This would convert 7:30pm to 19:30 and when you
subtract 7:30, you would have 12 which would be the correct number of hours.
 
F

fredg

I'm trying to find a formula that will calculate the number of hours between
the time I start work and finish work.
I have one column (A2) that says 7:30am and one Colum (A3) that says 7:30pm.
Does anyone know how to help me?

The field's are both DateTime datatypes?
Look up the DateDiff function in VBA help.

In hours?
=DateDiff("h",[StartTime],[EndTime])

In minutes?
=DateDiff("n",[StartTime],[EndTime])

Hopefully you are already storing the date as well as the time in
those 2 fields, i.e. 5/7/2008 07:30 AM, so that times past midnight
will be correctly calculated.

You do know, I hope, that this resulting time value should not be
stored in any table. Any time you need the result, simply recalculate
it.
 
Top