Dear Paul, Sorry for the very delayed reply. This is my friend data, I have suggested him to track the time in correct format.
Thanks a lot for your help. Regards, Vijayendra 2014-10-15 22:15 GMT+05:30 Paul Schreiner <[email protected]>: > The problem is with the way the times are entered. > We have a NUMBER that's being INTERPRETED as time. > But the same interpretation isn't always true. > > In once case, 10.50 is interpreted as 10:50PM > in another case, 17.00 is interpreted as 5:00am of the next day. > > Then there's a start time of 21.00 WHAT IS THAT? > > > in order to handle this, we have to be able to apply rules consistently. > > Either we determine where the numbers are coming from (the data source) > and modify how they are entered, or we have to somehow figure out > consistent rules. > > --------------------------------------- > If changing the way the numbers are entered is an option, then that would > be best. > > The most logical and consistent way would be to make the cell contents be > an ACTUAL date/time. > > In the line for February 13, the start time can be entered as: > 2/13/2013 9:00 AM > You can actually change the display format to: > h.mm > and it will DISPLAY as 9.00 > but the actual VALUE is a REAL Excel date/time. > > since the end time was the next day, > the entry would be: 2/14/2013 5:00 AM > > --------------------------------------- > > If you don't have any control over how the entries are made, then we have > to work on the rules. > To be honest, I can't see anything consistent. > > If a number in the start time (AM) column is over 12, does that mean it > was a PM value? > if a number in the Out time(PM) column is over 12, does that mean it is AM > of the following day? > > I might be able to work with that. > but for Feb 11, does 21.00 mean that the start time is 9:00pm > and 16.00 means that the end time is 4:00am of the next day? > > We could test the converted "out time" to see if it is less than the "In > time" and if it is, then add 12 hours to the out time > > ---------------------- > > To be honest, all of these formulae are working to accomplish one thing: > convert a number into a time and perform a calculation. > > I don't know if you have any familiarity with VBA macros... > But attached is a workbook in which I created a Change Event macro. > You can enter the time as you have been (8.10, 17.20, etc) > and it will convert the time to a date/time based on the criteria i've > observed. > > Then, it's simple subtraction to get the hours (well, subtraction gives > you a fraction of DAYS, so you have to multiply it by 24 hours/day) > > But you can DISPLAY the value how you choose. > > If you don't like it, or you don't want to dive into the world of macros, > then nevermind. > > *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:* Wednesday, October 15, 2014 11:14 AM > > *Subject:* Re: $$Excel-Macros$$ Help in Time Tracker > > Dear Paul, > > Thanks for your formula. It worked everywhere except any day which worked > more than 12 hours. I have attached excel file after putting your formula. > > Few days employee worked more than 12 hours. Eg. on 13rd February employee > came to office @ 9.00 am and returned next day of @ 5.00 am. As it is next > day, i have added 12 hours. Is there any other way to rectify this problem. > > > 2014-10-14 17:01 GMT+05:30 Paul Schreiner <[email protected]>: > > The problem seems to be with morning entries between midnight and 1:00am. > in the time() function, 12 is noon rather than midnight. > so the function thinks the time is after noon in stead of after midnight. > > To fix that you can subract 12 from the hours. > If the result is negative, the time() function will produce an error and > you can try it without subtracting 12: > > =IFERROR(TIME(INT(C42)-12,(C42-INT(C42))*100,0), > IFERROR(TIME(INT(C42),(C42-INT(C42))*100,0),"")) > > The entries OUT time seems to have some issues. > Why are some of the "out" times greater than 12? > > what does this number represent? > > > *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:* Tuesday, October 14, 2014 3:30 AM > *Subject:* Re: $$Excel-Macros$$ Help in Time Tracker > > Dear Paul, > > Thank you very much your help, i have applied your formulas in my sheet > and it works perfect. I am facing problem in total hours, it is showing > some wrong figure. > > Can you please help on this. Attached is the sheet. > > > > 2014-10-13 20:59 GMT+05:30 Paul Schreiner <[email protected]>: > > 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. > > > > > -- > ಧನ್ಯವಾದಗಳು, > ವಿಜಯೇಂದ್ರ, > ೯೪೪೯೧ ೬೭೬೩೧ > > 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. > > > > > -- > ಧನ್ಯವಾದಗಳು, > ವಿಜಯೇಂದ್ರ, > ೯೪೪೯೧ ೬೭೬೩೧ > > 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. > -- ಧನ್ಯವಾದಗಳು, ವಿಜಯೇಂದ್ರ, ೯೪೪೯೧ ೬೭೬೩೧ 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.
