get total hours from 2 dates

G

Guest

I need the total time from to dates.
My class starts on 6/10/2005 8:00
My class end on 6/11/2004 16:00

My excel spreadsheet has 6/10/2005 8:00 in one cell and 6/11/2004 16:00 in
another.

When I just do a date difference I get about 32 total hours which is wrong.
The total hours should be 16 hours since the class runs from 8:00 to 16:00
each day.
Help please
 
B

Biff

Hi!

If your class days are always Monday through Friday you could use the
Networkdays function for this.(and the formula would be less complicated
than the one below!)

Here's something that will work:

A1 = 6/10/2005 8:00
B1 = 6/11/2004 16:00

=((INT(B1)-INT(A1))-1)*8/24+SUM(MIN(16/24,MOD(B1,1))-8/24,MAX(16/24,MOD(A1,1))-8/24)

Format the cell as [h]:mm

Biff
 

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