Hours zero display

DDH

Well-known Member
Joined
Sep 25, 2003
Messages
513
I am trying to have a hour displayed as 15 hrs not 015 hrs.

Cell I 10 in Text format 10-11-2019 3:48 PM
Cell L 10 in Text format 10-12-2019 7:38 AM

Formula in M 10 INT(L10-I10)&TEXT(L10-I10,"h"" hrs ""m"" mins """)

it returns the answer of 015 hrs 50 mins.

I am trying to have it return 15 hrs 50 mins I don't know how to not have it display the zero in front of the 15 hrs.

Thank you for your help.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Between I10 and L10 there is quite 1 month difference, it cannot gives only 15 hours
 
Upvote 0
I am trying to have a hour displayed as 15 hrs not 015 hrs...
Just remove the INT(L10-I10)& part -- it actually shows number of days between the timestamps. The formula becomes

=TEXT(L10-I10,"h"" hrs ""m"" mins """)
 
Upvote 0
Just remove the INT(L10-I10)& part -- it actually shows number of days between the timestamps. The formula becomes

=TEXT(L10-I10,"h"" hrs ""m"" mins """)

Tetra201 & PCL - Thank you for your reply. Removing the INT(L10-I10)& made it work perfect, I never thought of doing that. PLC - I am sorry I did not understand what you meant.
Thank you very much for all of your help. ddh
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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