Results 1 to 10 of 29

Thread: Code Required to calculate number of days worked, normal overtime and holiday overtime

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    Hi Nelson,

    I hope I have the correct Files and understand the Logic: I see with the last Files you sent that:
    Two things are happening,
    ___ Totals are made and pasted out
    And
    ___ Normal Hrs ( Column I ) and Overtime Hrs ( Column J ) are to be changed


    So I this is what I understand is the requirement and have done:

    Rem 1) The code is set to work on the Active Workbook. That is the one you “looking at”. ( Any Worksheet can be selected )



    Rem 2) Total No, of days is simply taken as a constant of 30. (Const TDays As Long = 30)

    '3b)
    _ Date ( Column E ) and Total hrs ( Column H ) are required to use in calculations

    _ Normal Hrs ( Column I ) are needed as they must be set to zero for Holy ?? Holidays ?? Friday ??
    _ Overtime ( Column J ) is needed as it will be changed and then used in calculations.

    '3d) We need to check for a Holy?? Holiday?? Friday??
    ___If so Then
    ____ Total Hrs ( Column H ) are added to Overtime Hrs ( Column J ) according to the following rules:
    ____ (i) If Total Hrs are less than or equal to 9 , Then all Total Hrs are Given To to Overtime Hrs
    ____ (ii) Else If Total Hrs are greater than 9 , Then ( Total Hrs – 1 ) are Given To to Overtime Hrs

    ____ (iii) Normal Hrs ( Column I ) are then Emptyed.

    _3e)
    _ As in all my codes, Normal Overtime is simply calculated from summing hours in column J only If there are Overtime hours in column J And there are Normal hours are in column I.
    ( The total number will be entered into cell G34 )

    _ As in all my codes, Holiday Overtime is simply calculated from summing hours in column J only If there are Overtime hours in column J And there are no Normal hours are in column I.
    ( The total number will entered into cell J34 )

    _3f)
    The total number Normal Overtime entered into cell G34
    The total number Holiday Overtime entered into cell G34
    The value of 30 for Total days is simply added to cell C34

    _ 3g Normal Hrs ( Column I ) and Overtime Hrs ( Column J ) are changed
    _...


    _._______________________________


    '_- ExPlanations are given in code ' Comments, ( especially for snb ; ) )

    Code is here: ( Post #19 )
    http://www.excelfox.com/forum/showth...0066#post10066
    http://www.excelfox.com/forum/showth...age2#post10066


    Typical Results for one Worksheet are given in next 2 Posts


    Alan
    Last edited by DocAElstein; 02-03-2017 at 09:17 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    _...KILL A MODERATOR!!

Similar Threads

  1. Replies: 33
    Last Post: 01-12-2015, 10:08 AM
  2. Replies: 1
    Last Post: 07-23-2013, 10:43 PM
  3. Replies: 0
    Last Post: 09-17-2012, 02:05 PM
  4. The Number of Years, Months and Days Between Two Dates
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 7
    Last Post: 06-08-2012, 10:35 PM
  5. Number of Days In A Month
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 05-14-2011, 08:00 PM

Posting Permissions

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