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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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