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. #9
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Quote Originally Posted by Admin View Post
    ..... you can add one more column at the end to highlight which is the normal working day or holiday rather than coloring the cell......
    Hi Admin
    I was a bit confused at first.
    I see now what you have done now.
    You have taken his AFTER and applied a SUMIF on the two columns I and J....

    So first , You added then the extra column K with H for Holiday and N for normal day,
    After Worksheet
    Row\Col
    E
    F
    G
    H
    I
    J
    K
    1
    21.Dec.16
    7:00
    18:00
    11:00
    9:00
    2:00
    N
    2
    22.Dec.16
    7:00
    18:00
    11:00
    9:00
    2:00
    N
    3
    23.Dec.16
    7:00
    15:00
    8:00
    8:00
    H
    4
    24.Dec.16
    7:00
    18:00
    11:00
    9:00
    2:00
    N
    5
    25.Dec.16
    7:00
    18:00
    11:00
    9:00
    2:00
    N
    Worksheet: 121

    Then you have these formulas:
    Row\Col
    G
    H
    I
    J
    35
    =SUMIF(K1:K31,"N",J1:J31)
    =SUMIF(K1:K31,"H",J1:J31)



    If Nelson wanted to do that he would still need to use part of my code to get the AFTER worksheet in its final form, as his start point , the BEFORE File is a bit different and needs a bit of manipulation based on his various criteria. ( Columns I and J needed to be adjsued:
    BEFORE
    Row\Col
    E
    F
    G
    H
    I
    J
    1
    21.Dec.16
    7:00
    18:00
    11:00
    9:00
    2:00
    2
    22.Dec.16
    7:00
    18:00
    11:00
    9:00
    2:00
    3
    23.Dec.16
    7:00
    15:00
    8:00
    9:00
    0:00
    4
    24.Dec.16
    7:00
    18:00
    11:00
    9:00
    2:00
    5
    25.Dec.16
    7:00
    18:00
    11:00
    9:00
    2:00
    Worksheet: 121

    _...........

    By the way, I originally assumed that Holiday was a “Holy Friday thing”, ( So I was checking in my code for Friday and not yellow background color )but I am not sure if that is correct.
    What I will do in the next posts to cover my back and to let your solution work is do another code, which checks based on the background colour being yellow for a holiday, then does the manipulation of the Worksheet, but also then after that includes your “H” or “N” in col.umn K, and while I am at it I will pastes in your formulas:

    I expect then Nelson will have more than enough to keep him busy or confuse him

    Alan
    Last edited by DocAElstein; 02-05-2017 at 07:21 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
  •