Calculate the hours between two times

  • Thread starter Thread starter daisy
  • Start date Start date
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?
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top