Hours zero display

DDH

Active Member
Joined
Sep 25, 2003
Messages
497
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.
 

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,345
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,471
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

Active Member
Joined
Sep 25, 2003
Messages
497
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
 

Forum statistics

Threads
1,081,976
Messages
5,362,513
Members
400,679
Latest member
alecalec202

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top