hh:mm:s format to mask leading zeros and/or leading zero hours.

travellerva

New Member
Joined
Mar 31, 2012
Messages
47
Office Version
  1. 365
Platform
  1. MacOS
For the life of me I can't see how to set a custom format for time, where leading zeros don't appear. Also values less than one hour should only show mm:s

Typical displayed values I need are:

7 (seconds)
34 (seconds)
3:45 (minutes; seconds)
38:55 (minutes; seconds)
2:43:12 (hours, minutes, seconds)
11:24:56 (hours, minutes, seconds)

I would accept 11:04:35

I thought [h]:mm:s would work, but it doesn't

Many thanks
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Now these won't be actual times, but if those are entered as whole numbers I think this will display them that way.

[>5959]#0\:00\:00;[>59]0\:00;0

Book1
A
17
234
33:45
438:55
52:43:12
611:24:56
Sheet1
 
Upvote 0
Thanks, Scott, for your reply. Unfortunately I cannot make your suggestion work. Maybe I should be more clear about what I need.
ValueDisplay as
0.00009​
8​
0.0005​
43​
0.002​
2:53​
0.015​
21:36​
0.3​
7:12:00​
0.46​
11:02:24​

What custom format code do I use to get these displays in the second column (sorry - I can never figure out how to paste an xl2bb.xlsm on my Mac)
 
Upvote 0
Thanks. That almost works. It shows the Value 0.46 to be 11:2:24. I prefer 11:02:24. Is that possible?

Also Value 0.3 shows as 7:12:0 as opposed to 7:12:00

All the others show as needed.
 
Upvote 0
Bingo! I get the general idea. I did this and got what I needed in all examples

[>0.041666]h:mm:ss;[>0.000694]m:ss;s

Thanks a lot.
 
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