+ Reply to Thread
Results 1 to 5 of 5

Formula to calculate the hours in a range that fall between different time categories

  1. #1
    Registered User
    Join Date
    11-19-2015
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    2

    Formula to calculate the hours in a range that fall between different time categories

    Hi everyone,

    I would be eternally grateful if anyone is able to offer a solution to this problem.

    I have created the attached timesheet based on the hospitality industry award rates (Aus.), where any hours worked between 7am and 7pm are 'Normal', hours between 7pm and middnight are 'Evening' and middnight to 7am is 'Late'. Saturday, Sunday and Public Holidays are then a different rate altogether.

    Basically I want the sheet to calculate the number of hours for each category based on the total hours worked by the employee. I am trying to eliminate human error by only requiring the hours worked to be entered.

    I have seen several other threads with queries similar to mine, based on Ordinary hours vs overtime, and I have tried those formulas in my sheet but they aren't working. I don't know how I am messing it up - I'm not a newbie to excel, but I seem to be suffering from a brain fart as far as this is concerned

    Any help would be muchly appreciated



    BGSA Timesheet.xlsx

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Formula to calculate the hours in a range that fall between different time categories

    1) Let's start with G12. If you do expect that person, who started work yesterday at 9PM and finished today 4AM writes hours of start and finish in the same row then checkin C<B is important and shall lead to:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    otherwise probably:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    would be enough (I limited checking only to TimeOut, because as long as time out cell is empty there is no data to calculate time, and (probably ;-) ) nobody will write only time out and leave empty time in. (You can setup a conditional formatting to alert a user about such situation)
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Formula to calculate the hours in a range that fall between different time categories

    Then H12:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I12:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    J12:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    K12:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and similar but with day = 7 in L12

  4. #4
    Registered User
    Join Date
    11-19-2015
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    2

    Re: Formula to calculate the hours in a range that fall between different time categories

    Hi Kaper,

    Thank you so much for your quick response and solutions to my problem, your formula's worked perfectly.
    I agree with your assessment of the formula I was using in G12. I have simplified it using your second option.

    Thanks again,
    F14H

  5. #5
    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,938

    Re: Formula to calculate the hours in a range that fall between different time categories

    Quote Originally Posted by Kaper View Post
    (You can setup a conditional formatting to alert a user about such situation)
    or maybe Data Validation so you cannot enter a tome Out if there is no time IN
    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

+ 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] Formula Needed - Calculate total hours that fall between a specific time period.
    By JennyGP in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 04-19-2020, 02:44 AM
  2. [SOLVED] Formula to calculate: # of hours in a timespan that fall between Midnight and 6AM
    By Deicidium in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-23-2015, 05:05 PM
  3. [SOLVED] Need formula to calculate number of hours in a time span that are between 6PM and 6AM
    By gibson2503 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-05-2014, 06:13 PM
  4. Calculate number of occupied hours within time range
    By Moe2 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-29-2014, 11:07 AM
  5. [SOLVED] Formula to Calculate Normal Hours, Time & 1/2 & Double Time from Daily Hours per week
    By KazzICC in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-17-2014, 01:51 AM
  6. [SOLVED] Counting hours and minutes that fall within a date range
    By Harrytheb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-25-2013, 05:42 PM
  7. Replies: 9
    Last Post: 07-26-2012, 10:01 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