Formula for Time in Excel

  mgmcc 16:09 05 Jul 09
Locked

I'm looking for the formula to subtract one time from another and give the answer in hours to 2 decimal places, not hours and minutes.

In other words, Start 08:00 Finish 18:15 - I want an answer of 10.25 hours, not 10:15 (ten hours, 15 mins).

  Simsy 18:36 05 Jul 09

of how you format the cell... and how you have the formula...

You need to have the cell with the answer in formatted as a number, (to 2 decimal places, as that's what you seem to want). This will give the answer as a fraction of 1 day...

Then have your formula, (=B2-A2), and multiply it by 24 to give the answer in hours...

eg if the start is in A2, and the end is in B2, the fomula would be;

=(B2-A2)*24

Regards,

Simsy

  mgmcc 18:59 05 Jul 09

Many thanks, exactly what I was looking for.

  VoG II 20:11 05 Jul 09

If your times can span midnight then you need

=(MOD(B2-A2,1))*24

  mgmcc 13:49 06 Jul 09

Some of the times do span midnight but I'd actually got round this with an "IF" statement - if the subtraction resulted in a negative number, 24 was added to it. However, I'll have a play about with your formula.

Thanks.

This thread is now locked and can not be replied to.

LG G6 review: Hands-on with LG’s bold, big-screen shot at perfection

1995-2015: How technology has changed the world in 20 years

How the painting-like animated sequences in A Monster Calls were created by Glassworks Barcelona

The 22 best Safari extensions | Best Safari plugins: Improve Apple's Safari web browser with these…