As you undoubtely noticed, the number 8.45 does NOT represent 8 hours and 45 
minutes,
but 8 hours  and .45 of an hour, which is 8 hours and 27 minutes.
 
you cannot simply subtract these number and interpret the numbers as time.
 
 
Now, to excel, a DATE is actually the number of days since 1/1/1900.
So, Saturday, February 01, 2014 is actually stored in Excel as: 41671
 
TIME in Excel is a fractional part of a day.
 
8:45 AM is actually .3645833 of a day.
8:10 PM is actually .8402778 of a day.
 
THESE numbers you can subtract (.47569444)
since there are 24 hours in a day, then 24*.47569444 = 11.4166667 hours.
 
So, your task is to convert your numeric representation: 8.45 to an actual 
excel "time" value.
 
there is an Excel function called TIME(), which takes hours, minutes and seconds
and converts it to an excel time.
 
The "hours" portion of 8.45 is found by using int()
 
For the in-time in cell C3, you can use =INT(C3) (results in 8)
For the "minutes" portion, you have to subtract the hours:
=C3-INT(C3)
But that gives you .45 so multiply it by 100 to get "45":
=(C3-INT(C3))*100
 
the end result is:
=TIME(INT(C3),(C3-INT(C3))*100,0)
 
Now, your "OUT TIME" is done the same way, but the hour figure needs to have 12 
added to it go show a PM time:
=TIME(INT(D3)+12,(D3-INT(D3))*100,0)
 
This gives you two "Excel time" values, which you can subtract to get the 
fractional part of a day:
 .47569444
 
Now, since there are 24 hours in a day, you need to multiply this value by 24 
to get:
11.4166667 hours
(which is .4166667 HOURS, not 41.667 minutes!)
 
let me know if you need help applying this logic to your workbook.

Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------

 From: Vijayendra Rao <[email protected]>
>To: [email protected] 
>Sent: Monday, October 13, 2014 10:39 AM
>Subject: $$Excel-Macros$$ Help in Time Tracker
>  
>
>
>Dear Experts,
>
>
>Can you please help me to convert time to numbers. Attached is the my file and 
>my formula is showing some wrong numbers. Request you to help on the same. 
>
>Regards,
>Vijayendra
>94491 67631 
-- 
>Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
>=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>https://www.facebook.com/discussexcel
> 
>FORUM RULES
> 
>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
>quick attention or may not be answered.
>2) Don't post a question in the thread of another member.
>3) Don't post questions regarding breaking or bypassing any security measure.
>4) Acknowledge the responses you receive, good or bad.
>5) Jobs posting is not allowed.
>6) Sharing copyrighted material and their links is not allowed.
> 
>NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
>members are not responsible for any loss.
>--- 
>You received this message because you are subscribed to the Google Groups "MS 
>EXCEL AND VBA MACROS" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to [email protected].
>To post to this group, send email to [email protected].
>Visit this group at http://groups.google.com/group/excel-macros.
>For more options, visit https://groups.google.com/d/optout.
>
>
>    

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to