Count the number of hours/durations

J

Jafferi

Cell A1 ---- Jan 1, 2010
Cell A2 ---- 10:58 [AM]
Cell B1 ---- Jan 3, 2010
Cell B2 ---- 22:10 [PM]

What is the formula that I can use to give me the results of no of hours
between Jan 1, 2010 at 10:58AM to Jan 3, 2010 22:10 PM?
 
D

David-Melbourne-Australia

Hi Jafferi

The following formula does the job:
=(A3-A1+A4-A2)*24

This works out precisely how many hours down to the decimal places.

If you want the number of whole hours:
=int((A3-A1+A4-A2)*24)

If you want the number of whole hours rounded to the nearest hour:
=round((A3-A1+A4-A2)*24,0)

Hope this helps.

David
 
P

Per Jessen

Hi

Use this formula and format the formla cell a Custom > [h]:mm

=B1-A1+(B2-A2)

Regards,
Per
 

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

Top