Problem calculating times for full day difference

SteveNL86

Board Regular
Joined
Nov 11, 2014
Messages
109
Office Version
  1. 2016
Platform
  1. Windows
Dear reader,

I'm trying to calculate the difference between 2 diferent times. My formula is working apart from in 1 spot.

8:00 AM8:00 AM0:00
4:00 PM11:00 PM7:00
4:00 PM11:00 PM7:00
8:00 AM4:00 PM8:00
10:00 AM6:00 PM8:00
8:00 AM4:00 PM8:00
11:00 PM8:00 AM9:00
8:00 AM1:00 PM5:00
1:00 PM6:00 PM5:00
--0:00
6:00 PM11:00 PM5:00
1:00 PM8:00 PM7:00
4:00 PM11:00 PM7:00
4:00 PM11:00 PM7:00
8:00 AM4:00 PM8:00
10:00 AM6:00 PM8:00
8:00 AM4:00 PM8:00
11:00 PM8:00 AM9:00
11:00 PM4:00 AM5:00

=IF(F2="-";0;IF(G2>F2;G2-F2;G2+1-F2))
Is the formula I'm using. But I want it to give 24 hours as results in the first row.

Any help is much appreciated!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You need to format the cells as [h]:mm
 
Upvote 0
Solution
When I change to fractions I can see it does give me 1 as result, but changing it to h:mm doesn't seem to work. It won't show 24 hours.
 
Upvote 0
That is not the format I suggested ;) you need the square brackets.
 
Upvote 0
Thank you Fluff,

I was actually running in a bit of a mess at first because Excel would keep saying it can't change to that format. Turns out thats due to my language settings.
Changing the format to [u*]:mm without the * did the trick.

Thanks for your help!
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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