+ Reply to Thread
Results 1 to 27 of 27

Calculating Start and End times

  1. #1
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Calculating Start and End times

    Hey everyone,

    I am trying to create a time sheet and roster with excel. I have attached the template i have created

    I have the layout and basic functionality of the time sheet done but i am trying to achieve 2 things that i am having trouble with.

    1) with the time sheet, I am trying to calculate the difference in hours between 2 times (but i want the data to be entered in such a way where they just enter the number rather than 12:00:00opm for instance.

    2) based on the time sheet i am trying to get excel to pull the information automatically onto a next worksheet where it shows the time each person worked on a graphical format so that it looks like a calendar would for instance.

    Thanks in advance for the help
    Attached Files Attached Files
    Last edited by jame24; 03-13-2012 at 09:17 PM.

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: help with Time Sheet and Roster

    this shoudl work for you first option, for you second, coudl you provide a desired output?

    =IF(F9=H9,G9-E9,G9-E9+12)
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: help with Time Sheet and Roster

    thanks mate....that worked brilliantly

    as for point 2, please see attached of what I'm looking to achieve.

    Im thinking some form of vlookup would determine what time the sift started and a value such as "1" would be displayed in each cell and a conditional formatting would make it a specific colour?!?!?

    look forward to hearing from you.
    Attached Files Attached Files

  4. #4
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: help with Time Sheet and Roster

    that should work out for you, but instead of a vlookup, you will need to use an if statement to determine if that hour was worked, something like this:


    Please Login or Register  to view this content.
    the TIMEVALUE portion just converts your enterd time into a useable time. and i also added a check incase someone works a late night.

  5. #5
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: help with Time Sheet and Roster

    Thanks a lot. that did the trick.

    if i wanted to change it so that it can pick up start times at the half hour mark (eg 8:30) how would the formula above and in the first worksheet change to reflect that? i keep trying to vhange the formating and even entering for instance 8.5 but that doesnt seem to be working.

    also if from the first worksheet, the start time is in the PM and end time is in the AM, the graph doesnt seem to track it? wondering if you could give some advice on this.

    cheers mate

  6. #6
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: help with Time Sheet and Roster

    This will account for the 8.5 type senario, as for the shifts ending overnight, technicaly they would move into the next day so ill have to think about how to make that work with your current set up (or you could extend your time ranges into the late night)

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: help with Time Sheet and Roster

    Hey

    I tried the formula you made, it does not seem to be working. I have included the updated form i have been working on to see if i have been doing something wrong.

    Thanks
    Attached Files Attached Files

  8. #8
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: help with Time Sheet and Roster

    sheet name changed, try this (confirmed with Ctrl+Shift+Enter)

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: help with Time Sheet and Roster

    Hey

    When i use 5.5 as a start time the graph doesn't pick it up? any reason why this would happen? sorry for all the questions I have attached the file i am working on now

    thanks
    Attached Files Attached Files

  10. #10
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Calculating Start and End times

    typo in the formula, sorry about that this is for C4

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Calculating Start and End times

    Hey,

    I tried to switch the time so that I can enter the start time as 8:30 as oppose to 8.5 (on advice from my coworkers). How would I do this with regards to the formulas?

    I dont seem to be getting it to work as the format it comes in is very rigid in the sense that it comes in the format hh:mm AM/PM (all in one cell). where I would want them to enter just the number in one cell and AM/PM in the other without conflicting

    thanks in advance

  12. #12
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Calculating Start and End times

    this portion of the formula is converting to a time value, you just need to replace it with an actual reference to the time you want to look at

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Calculating Start and End times

    Hey man,

    Sorry for the abundance of questions, and i dont mean to sound like such a noob but, im still really confused about what this formula is trying to say or how to manipulate it

    thanks again

  14. #14
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Calculating Start and End times

    no problem, ill break it down for you

    =IF(AND(TIMEVALUE(INT(LP!$F$10)&":"&TEXT((LP!$F$10-INT(LP!$F$10))*60,"00 ")&LP!$G$10)<=$A4,TIMEVALUE(INT(LP!$H$10)&":"&TEXT((LP!$H$10-INT(LP!$H$10))*60,"00 ")&LP!$I$10)+IF(AND(LP!$G10="PM",LP!$I10="AM"),0.5,0)>=A4)," "," ")

    IF Start time <= This Interval And End Time >= This Interval then do this " " or else do this " "

  15. #15
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Calculating Start and End times

    Ok better now. Thanks

    How about the netering of the time as 8:30 instead of 8.5. The formulas are getting messed up because of that. Any ideas?

    Thanks again.

  16. #16
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Calculating Start and End times

    =if(and(lp!$f$10<=$a4,lp!$h$10>=a4)," "," ")

  17. #17
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Calculating Start and End times

    Once again..so sorry for being annoying.

    for the 8.5 to be entered as 8:30, i was actually trying to get it to work on the LP page so that the hrs and $ can be calcualted properly. any advice?

    Thanks

  18. #18
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Calculating Start and End times

    for hours just use

    =(H10-F10)*24

    and for $ just multiply that by your rate of pay

  19. #19
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Calculating Start and End times

    Hey,

    I more so asking about collmun F and H. When i enter the start time as 5.5 for instance, eveerything works out fine. but i want to change that so i can enter the information as 5:30.

    However when i neter it as 5:30, the number comes up as 5:30:00 PM. I want it to just show up as 5:30 since I have the second collumn asAM/PM. the reason i dont want it be as 5:30:00 PM is because it will be too complicated for the people using it to understand as they are not very proficient at excel( infact almost beginners).

    Is there a way to just enter the info as 5:30, it stays in that format and hrs can be calculated automatically from that (using the AM/PM columns i have. I even tried adding a hidden collumn that can aggregate the info but cant seem to figure it out.

    Thanks once again

  20. #20
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Calculating Start and End times

    you would want to do that with formating, right click the cell, go to formating and make sure its formated as H:MM, then you can format the cell with AM/PM in it as "AM/PM"

  21. #21
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Calculating Start and End times

    when i enter 5:30 in F and AM in G, in the actual cell, it shows up as 5:30, but on the formula bar (under the ribbon) it shows up as 5:30:00 PM in F. I believe this is why the hrs arent calculating properly. As mentioned above, for the people using this to go into the formula bar to change AM to PM or what not, it would be too diffiuclt

    Is there a way tojust have the 5:30 pull or if i enter just 5 for it to pull as 5:00. I created another column but cant seem to get the formula right. I tried LEFT(XX,5) but that doesnt seem to work

    Thanks

  22. #22
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Calculating Start and End times

    because you are using a time value, it needs to be an actual time value, you cannot just drop a portion of it out.

    you could use 3 cells (Hours, Minute, AM/PM) to build the time value, that might work for you case.

  23. #23
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Calculating Start and End times

    Hey thanks. Last question, i promise

    Updated the model to take that into account. Would you be able to just recreate the forumala for the Roster graph to take into account the HR, Min and AM/PM i created?

    I have attached the model I'm working with nowLP and Roster Chart.xls

    Thanks once again

  24. #24
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Calculating Start and End times

    please see attached and let me know if you have any quesitons.

    if you want you can hide columns L and M in on sheet LP
    Attached Files Attached Files

  25. #25
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Calculating Start and End times

    can't seem to get the roster graph working...can you please take a look at it, keeping all other formulas as is?

    thanks
    Attached Files Attached Files

  26. #26
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Calculating Start and End times

    your time value formulas were inconsistant, i also fixed up the formulas on the graph so they can fill down.
    Attached Files Attached Files

  27. #27
    Forum Contributor
    Join Date
    05-14-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    187

    Re: Calculating Start and End times

    Hi,

    Can you try my timesheet and use similar formulas in your sheet

    Regards,

    Veejar
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1