Calculating difference between start and end time

jessika2105

New Member
Joined
Oct 4, 2022
Messages
1
Office Version
  1. 2003 or older
Platform
  1. Mobile
Hi. I have checked on Internet. If I enter 8:00 pm in start time (cell A2)and enter 8:00 am in End time. (Cell B2). To calculate the difference, I have inserted the formula = (b2-a2)*24 I have then converted the formating to General to have the number of hours. However why I am getting -12
Second question from 8:00 pm to 8:00 am, I should get 11 hours, but I'm getting -13
Kindly help me
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Try this formula :
=IF(end>start, end-start, 1-start+end)
example : =IF(B2>A2;B2-A2;1-A2+B2)

To see the result in hours and minutes, apply a time number format like this: hh:mm
 
Upvote 0
Another option.
Format cell as [h]:mm

Book2
ABC
1
28:00 PM8:00 AM12:00
Sheet1
Cell Formulas
RangeFormula
C2C2=MOD(B2-A2,1)
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top