View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
HARSHAWARDHAN. S .SHASTRI[_2_] HARSHAWARDHAN. S .SHASTRI[_2_] is offline
external usenet poster
 
Posts: 69
Default Convertin hours into days, hours and minutes

Dear Jock,

Following formula will solve your problem

=INT(LEFT(TEXT(Q5,"hh:mm"),2)/7.5)&"d
"&INT((MOD(LEFT(TEXT(Q5,"hh:mm"),2),7.5)*60+MID(TE XT(Q5,"hh:mm"),4,2))/60)&"h
"&(((MOD(LEFT(TEXT(Q5,"hh:mm"),2),7.5)*60+MID(TEXT (Q5,"hh:mm"),4,2))/60)-INT((MOD(LEFT(TEXT(Q5,"hh:mm"),2),7.5)*60+MID(TEXT (Q5,"hh:mm"),4,2))/60))*60&"m "
--
HARSHAWARDHAN.S.SHASTRI

Pl do not forget to press "YES" button if post found useful.


"Jock" wrote:

Common question and I've looked at a number of different answers in the
forum. None quite work for me though.
I can get the days part ok using INT, its the leftover hours and minutes
which is giving me grief" The following nearly gets the
=INT((Q5/7.5)*24)&" day "&TEXT(MOD(Q5,7.5),"hh"" hours"" mm"" minutes""")
However with 15:13 (hh:mm) in cell Q5, the result is 2 d 15h 13m rather than
2d 0h 13m

Any ideas?

--
Traa Dy Liooar

Jock