Solution 1:

You're going to have to convert those hours into something Excel can understand.

Assuming your hours are in decimal form (e.g. 25.5 hours, 37.25 hours), here's how you can do it:

Step1:
Divide the amount by 24.
This gets the hour-day ratio, or converts the amount to a fraction of a day (e.g. 25 hours converts to 1 1/24 or 1.04).

Step2:
Change the number format of the cell that contains the formula or converted value to Custom
(press Ctrl + 1 > Custom). Use this format string:

[<=0.0416551] [m]"m";[<1]h"h" m"m";d"d" h"h" m"m"

0.0416551 = 0:59:59 in decimal

or

[<1]h"h" m"m"; d"d" h"h" m"m"

or

d"d" h"h" m"m"

Example: enter image description here

Solution 2:

If the time is in hours, then this is one way:

=TRUNC(A1/24) & "d " & TRUNC(A1-TRUNC(A1/24)*24) & "h " & 
       60*((A1-TRUNC(A1/24)*24)-TRUNC((A1-TRUNC(A1/24)*24))) & "m"