+ Reply to Thread
Results 1 to 11 of 11

Calculating Allocated Hours Based On Clock In and Clock Out

  1. #1
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    Calculating Allocated Hours Based On Clock In and Clock Out

    Hello Experts
    I have an excel sheet in which depending on the clock in and clock out
    excel calculates the allocated time. Default allocated time is 4 hours

    So if a person does an 8 hour shift, the allocated hours should show 4 hours
    if a person does an 9 hour shift, the allocated hours should show 4 hours

    and if the person doesn't clock in or out, the allocated hours should show zero

    I have attached screen shot and the excel file

    Please help

    Kind Regards
    Rahul
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Calculating Allocated Hours Based On Clock In and Clock Out

    allocated hours (no column in your file)

    =IF(worked Hours=0,0,4) ??


    in C8

    =IF(D8=0,0,4)

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Calculating Allocated Hours Based On Clock In and Clock Out

    I think you are making things far more complex than you need to.

    1. Instead if 1 sheet per day, why not put all data into 1 sheet and run your summaries from that? Rearrange the input so you also include a date
    2. Instead of all those INDIRECT()'s (if you dont do (1), do the calcs on each sheet in a helper cell, then just reference that, instead of...
    =((INDIRECT(L8&"'!$I$17")-INDIRECT(L8&"'!$I$13")+(INDIRECT(L8&"'!$I$17") < INDIRECT(L8&"'!$I$13")))-(INDIRECT(L8&"'!$J$15")-INDIRECT(L8&"'!$I$15")+(INDIRECT(L8&"'!$J$15") < INDIRECT(L8&"'!I15"))))*24
    3. For your actual question, maybe something like...
    =IF(TIMEEND-TIMESTART > 4/24,4/24,0)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Calculating Allocated Hours Based On Clock In and Clock Out

    I think you are making things far more complex than you need to.

    1. Instead if 1 sheet per day, why not put all data into 1 sheet and run your summaries from that? Rearrange the input so you also include a date
    2. Instead of all those INDIRECT()'s (if you dont do (1), do the calcs on each sheet in a helper cell, then just reference that, instead of...
    =((INDIRECT(L8&"'!$I$17")-INDIRECT(L8&"'!$I$13")+(INDIRECT(L8&"'!$I$17") < INDIRECT(L8&"'!$I$13")))-(INDIRECT(L8&"'!$J$15")-INDIRECT(L8&"'!$I$15")+(INDIRECT(L8&"'!$J$15") < INDIRECT(L8&"'!I15"))))*24
    3. For your actual question, maybe something like...
    =IF(TIMEEND-TIMESTART > 4/24,4/24,0)

  5. #5
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    Re: Calculating Allocated Hours Based On Clock In and Clock Out

    Hi John
    I just get a zero

    I don't know what I am doing wrong

    Regards
    Rahul

  6. #6
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    Re: Calculating Allocated Hours Based On Clock In and Clock Out

    Hi FDibbins
    Yes I think I have made it more complicated than what it needs to be
    I don't know how to simplify it

    I tried the =IF(TIMEEND-TIMESTART > 4/24,4/24,0)

    I get a zero

    Regards
    Rahul

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Calculating Allocated Hours Based On Clock In and Clock Out

    Rahul,
    Can you post a file showing "Allocated hours" column.

    I can't think why this doesn't work

    =IF(D8=0,0,4)

    as it simply checks if "Worked Hours" in D is zero, then "Allocated Hours" is 0, otherwise it is 4.

  8. #8
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    Re: Calculating Allocated Hours Based On Clock In and Clock Out

    Hi John
    I have attached my excel file

    I added a column Allocated hours, but it wont work
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Calculating Allocated Hours Based On Clock In and Clock Out

    Use

    =IF(D8=0,0,4/24)

  10. #10
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    Re: Calculating Allocated Hours Based On Clock In and Clock Out

    Hi John
    It works

    Thanks a lot

    Regards
    Rahul

  11. #11
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    Re: Calculating Allocated Hours Based On Clock In and Clock Out

    Hi John
    It works

    Thanks a lot

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] What time do I clock out to achieve 40 hours?
    By Tritekfire in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-11-2014, 01:39 PM
  2. [SOLVED] how to calculate hours worked using 24hr clock
    By will2k in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-28-2014, 07:43 PM
  3. [SOLVED] Formula with 24 hour clock and calculating over 24 hours
    By mcoda in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-25-2013, 09:22 AM
  4. 24 hour clock calculating total hours using midnight
    By Wilgoss in forum Excel General
    Replies: 8
    Last Post: 09-06-2010, 11:53 AM
  5. [SOLVED] how do I count a rota with no dates and using 24 hours clock
    By APYDS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-20-2005, 04:05 PM
  6. [SOLVED] Start Clock/Stop Clock
    By abfabrob in forum Excel General
    Replies: 9
    Last Post: 06-28-2005, 12:05 PM
  7. Total work hours as if it were a Time Clock
    By vinnievegas in forum Excel General
    Replies: 1
    Last Post: 06-27-2005, 03:05 PM

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