'How to hide zeros in days, hours and minutes in excel

I need some help. I would like to hide the zeros in my data. For example, "1d 7h 0m" converted to "1d 7h" only or "0d 4h 12m" to "4h 12m" only. Any either of them if it's zero should be hidden.

The data has already a formula in it however the output shows the zeros which I'm not sure how to hide them.



Solution 1:[1]

you can achieve this by using the formula(paste next to your data cell) shared in the below link: Formatting Time Durations in Excel, Unnecessary zeros

=IF(HOUR(A1)>0," "&HOUR(A1)&"h","")&IF(MINUTE(A1)>0," "&MINUTE(A1)&"m","")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RAVI KUMAR