+ Reply to Thread
Results 1 to 7 of 7

8 hours worktime

  1. #1
    Registered User
    Join Date
    01-03-2020
    Location
    US
    MS-Off Ver
    2019
    Posts
    85

    Exclamation 8 hours worktime

    Hi everybody,
    I have thousands of rows (about 37000 rows) in a sheet which contains lots of information. Some of those important information which are used for creating a report or chart are personnel names, their work time, and the corresponding date they have done their tasks. Because of some mistakes taken by the users who fill these information (using Network), some personnel work-time considering their date, exceeds 8 hours. So, I need to write a code in order to prevent any surplus work-time put into the table. For example, Alex worked for 8 hours (cumulative) in 21/05/2020, but the user who imported his information, has written 11 hours (cumulative) for that specific date and person. I want to write a code to prevent any work-time more than 8 hours for a day to be calculated. For better understanding, I created a sample datasheet. Please, guide me about this problem. How should I write a code in Excel or PowerPivot (DAX Code) to solve this issue in my large data sheet?
    Attached Files Attached Files
    Last edited by fa2020; 05-21-2020 at 11:20 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: 8 hours worktime

    This quick little macro will make a summary of data it finds in columns A:C and put the summary in G:I with a max of 8 hours per day summarized.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: 8 hours worktime

    You can also use datavalidation in column B for this

    =SUMIFS($B$2:B2,$A$2:A2,A2,$C$2:C2,C2)<=8
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  4. #4
    Registered User
    Join Date
    01-03-2020
    Location
    US
    MS-Off Ver
    2019
    Posts
    85

    Re: 8 hours worktime

    Quote Originally Posted by JBeaucaire View Post
    This quick little macro will make a summary of data it finds in columns A:C and put the summary in G:I with a max of 8 hours per day summarized.

    Please Login or Register  to view this content.
    Nice solution. Thanks.

  5. #5
    Registered User
    Join Date
    01-03-2020
    Location
    US
    MS-Off Ver
    2019
    Posts
    85

    Re: 8 hours worktime

    Quote Originally Posted by popipipo View Post
    You can also use datavalidation in column B for this

    =SUMIFS($B$2:B2,$A$2:A2,A2,$C$2:C2,C2)<=8
    Thanks. It was helpful.

  6. #6
    Registered User
    Join Date
    01-03-2020
    Location
    US
    MS-Off Ver
    2019
    Posts
    85

    Re: 8 hours worktime

    Quote Originally Posted by JBeaucaire View Post
    This quick little macro will make a summary of data it finds in columns A:C and put the summary in G:I with a max of 8 hours per day summarized.

    Please Login or Register  to view this content.
    Can you please add some explanation for each part of your code? I want to develop it to my own situation but I'm new to VBA.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: 8 hours worktime

    Please Login or Register  to view this content.

+ 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. Replies: 5
    Last Post: 09-12-2019, 04:16 AM
  2. Replies: 3
    Last Post: 07-24-2018, 03:24 AM
  3. Seperate simple hours, holiday hours and night hours
    By enitron in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-27-2014, 07:22 AM
  4. [SOLVED] Calculate hours with predefined Working Hours and Weekend Hours
    By garciapliz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-05-2013, 11:17 AM
  5. Worktime break sheets
    By meisuin in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 06-01-2012, 08:42 PM
  6. Excel VBA. Calculating worktime with different overtimes
    By bananajan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-26-2011, 10:54 AM
  7. worktime function
    By evgny in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-29-2005, 03:05 PM

Tags for this Thread

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