Calculating days and hours

W

Woodturner

How can I convert decimal days, eg 12.375 days, to days and whole hours? Ex.
12 days 3 hrs.?
 
J

JE McGimpsey

Hmmm.. 12.375 days would translate to 12 days 9 hours, wouldn't it?

IF (a) all your time spans are less than 32 days, and (b) you're using
the 1900 date system, you could just choose Format/Cells/Number/Custom:

d "days" h "hrs."

(which will round to the nearest hour).

Otherwise you could use

A1: 12.375
B1: =INT(A1) & TEXT(A1," \da\y\s h \hr\s.")
 
W

Woodturner

Thanks for the reply. I was thinking in terms of 8 hr. work days where .375
days would be 3 hours. (Didn't everyone think that?) I'm not a programmer, so
here is an example that may explain what I want to do better than me.

Ex. - 41 vacation hrs. equates to 5.125 weeks, or 5 weeks and one day. I
need to divide the original number of hrs. by 8 to get whole weeks, and then
multiply the decimal remainder by 8 to get the number of additional hours.

Can I use the MOD function some way to calculate the number of hours after
taking off the number of days? Maybe (n1 MOD n2)*8, where n1 is the
begininning number of vacation hours, and n2 is 8.

Have I been wordy enough?

Thanks again.
 
W

Woodturner

Well, after reading a bit closer about MOD, which I should have done to start
with, I see that it will not do what I want to do. Any more suggestions?
Thanks...
 
W

Woodturner

After reading even closer I see that the INT function will do what I want.

Thanks...
 
D

David Biddulph

=INT(A1) & " days " & 8*MOD(A1,1) & " hours" sounds like the answer to your
original question, but in your message below you have confused me when in
one breath you are referring to weeks and days (in some system where there
are apparently 8 days in a week!) and in another breath you are referring to
days and hours.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top