Duration time

CHML

Board Regular
Joined
Mar 19, 2023
Messages
57
Office Version
  1. 2019
Platform
  1. Windows
  2. Web
Hi. I am trying to get the duration time, but I am getting a bunch of number signs. Can someone kindy assist? Thanks
1702585632608.png
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I'm betting that if you put 13:00 into F, it would work.

It's probably taking 1:00 as 1:00am, and subtracting gives you a negative number. Formatting the negative number as a date/time is going to be problematic.
 
Upvote 0
Was also thinking but I would want time format to stay like this;
1702586544909.png
 
Upvote 0
=MOD(F2-E2,1)
Format as h:mm

If you want it as a decimal number
=MOD(F2-E2,1)*24
Format in the number format you want.
 
Upvote 0
Try this

Excel Formula:
=TEXT(F2,"h:mm")-TEXT(F2,"h:mm")
 
Upvote 0
No matter the format you still need the end time to be greater that the start time for the subtraction to give a positive number. Excel only can show positive times, or you get the ####.
So keep the format with AM / PM but you will have to haven ending time as 1:00 PM. not 1:00 AM.

StartEndEnd - Start
9:00 AM​
1:00 PM​
04:00:00​

Or is the 1:00 AM from the next day? If thats so you will have to add the date to the calculation.
 
Upvote 0
Which one do you mean in row 2 as Col A and Col B have dates?
Duration between: 9:00 to 1:00
OR
Duration between 9/25/2023 9:00 to 9/29/2023 1:00
 
Upvote 0
If you want to keep the formatting, you'll have to do:
Excel Formula:
=IF(F2<E2,0.5,0)+F2-E2
 
Upvote 0
Solution
@felixstraube, You're right about the AM/PM. It was my mistake.

Thank you all for coming forward with your assistance.
 
Upvote 0

Forum statistics

Threads
1,215,128
Messages
6,123,206
Members
449,090
Latest member
bes000

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