Hours zero display

DDH

Well-known Member
Joined
Sep 25, 2003
Messages
501
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.
 

Some videos you may like

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,348
Between I10 and L10 there is quite 1 month difference, it cannot gives only 15 hours
 

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,542
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 """)
 

DDH

Well-known Member
Joined
Sep 25, 2003
Messages
501
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
 

Watch MrExcel Video

Forum statistics

Threads
1,099,337
Messages
5,468,019
Members
406,563
Latest member
kdorClintR

This Week's Hot Topics

Top