Calculating hours

  • Thread starter Thread starter Ian
  • Start date Start date
I

Ian

Hi
I need to do a sheet where I put in a time, 7:15 for example in a cell. In
another cell I would enter 11:30 for example. The difference in time is 4.25
hours. What formula would I use to get this answer?
Thanks for any help
 
Assume the start time is in A1 and the finish time in B1, both in
Excel time format, put this formula in C1:

=(B1-A1)*24

Format C1 as a number with 2 dp.

Hope this helps.

Pete
 
Thanks Pete

I'll try that
Cheers
Ian

Pete_UK said:
Assume the start time is in A1 and the finish time in B1, both in
Excel time format, put this formula in C1:

=(B1-A1)*24

Format C1 as a number with 2 dp.

Hope this helps.

Pete
 
If you don't want to have to worry about changeing the formatting manually,
you could also try:

C1=VALUE(TEXT(((B1-A1)*24),"0.00"))

Where B1="11:30" and A1="7:15"

Thanks,
Mike
 
Sorry, but I'm confused, Mike. There's obviously some subtlety that has
escaped me. Why have you used TEXT to convert a number to text, and then
VALUE to change it back to a number again? What was wrong with simply
=(B1-A1)*24 ?
 
David, I think this was to force the formatting to "0.00" without
having to do it manually.

Pete
 
I wondered that, but after the VALUE aren't you back to a number that needs
formatting if you want anything other than the default? Doesn't the default
show as 4, rather than 4.00, if you have a 4 hour difference, despite the
TEXT function?
 
Yeah, you're right David - I've just tried it. Maybe Michael will come
back and explain his reasoning.

Pete
 

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