Time calculation

Ks1102

Well-known Member
Joined
Jan 8, 2008
Messages
685
Dear experts

may i have you help to have which formua can calcultion by number to time format!
for example

1110 - 916 = "hh:mm"


thanks very much.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

joeu2004

Well-known Member
Joined
Mar 2, 2014
Messages
3,021
Office Version
  1. 2010
Platform
  1. Windows
may i have you help to have which formua can calcultion by number to time format! for example
1110 - 916 = "hh:mm"

If you mean 1110 is the time 11:10 and 916 is the time 9:16, you cannot subtract the numbers 1110 - 916, then format as time.

Instead, you must format the numbers as time, then subtract as follows, if A1 is 1110 and B1 is 916:

=TEXT(A1,"00\:00") - TEXT(B1,"00\:00")

formatted as Custom hh:mm.

I assume that B1 is the start time and A1 is the end time. More generally:

=TEXT(A1,"00\:00") - TEXT(B1,"00\:00") + (A1<b1)
< B1)

That allows for an end time less than the start time because the time period spans midnight; that is, midnight is between the start and end times.
</b1)
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,129,472
Messages
5,636,516
Members
416,920
Latest member
Riskyplan

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
Top