Format formula column to show minutes and hours

Hey,

I have a column called “Hours” which displays a decimal of time so 2 is 2 Hours, 0.5 is 30 mins etc etc
How can I get a formula column to display the time as 00H 00M

I have tried this:
TEXT(ROUNDDOWN(({Hours})/3600,0),"#0") & "h " & TEXT(ROUNDDOWN(MOD(({Hours}),3600)/60,0),"00") & "m"
but I’m just getting 0 at the moment.

Any ideas please?

@johnners

You’ve got some good ideas there. Try this:
RIGHT("0" & INT({Hours}), 2) &"h "& RIGHT("0" & (MOD({Hours},1) * 60), 2) & "m"


Jim - The Monday Man (YouTube Channel)
What is Make & How can it help you?
We Create Custom Solutions
Schedule a 1-on-1 Tutorial Session (for monday, Make & Brain Teasers)

@JCorrell
Oh thats the closest I’ve had it, but its showing 0.8m in the formula but it should be 20m as its .33 hours?

hours

@johnners

Show your current formula text.

Oh sorry! I 've just taken your example and put that directly in the formula column,
RIGHT("0" & INT({Hours}), 2) &"h "& RIGHT("0" & (MOD({Hours},1) * 60), 2) & "m"

which is showing 0.33 as 0.8 rather than 20m - also 0.17 should be 10m
time

the 3 hours is right and the .25 (15m) is right too

@johnners

My bad.

This should do it:
RIGHT("0" & INT({Hours}), 2) &"h "& RIGHT("0" & ROUNDUP(MOD({Hours},1) * 60, 0), 2) & "m"


Jim - The Monday Man (YouTube Channel)
What is Make & How can it help you?
We Create Custom Solutions
Schedule a 1-on-1 Tutorial Session (for monday, Make & What’s for Dinner)

1 Like

@JCorrell

Amazing! Thank you so much!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.