Is there an Excel custom format string that will show seconds in a dd:hh:mm:ss
format, but hiding any leading zero values?
E.g., it is straightforward to format 100,000 s in dd:hh:mm:ss
as 01:03:46:40. However, for 50,000 seconds I would like to display as hh:mm:ss
(i.e. 13:53:20) not as dd:hh:mm:ss
(00:13:53:20), using a single formatting string for all values.
It can be achieved using TEXT formulas with something like:
IF(A1<60,
TEXT(A1/86400, "ss"),
IF(A1<3600,
TEXT(A1/86400, "mm\:ss"),
IF(A1<86400,
TEXT(A1/86400, "hh\:mm\:ss"),
TEXT(A1/86400, "d\:hh\:mm\:ss"))))
However this returns all values as text which doesn't allow numerical sorting of the values.
It can also be achieved with conditional formatting, but I'd prefer to use that only if I have to.
I'm hoping someone is going to tell me about the magical custom format string that will do the job!