+ Reply to Thread
Results 1 to 8 of 8

Problem with "IF(OR" within my time sheet.(or perhaps its just too early)

  1. #1
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Problem with "IF(OR" within my time sheet.(or perhaps its just too early)

    Good morning happy campers,

    Attached - is a time sheet i have come up with (only August has data in for now)
    And up until i added in more than 8 hours on the weekend it was working great.
    The sheet accurately records the overtime worked on a weekday but i cant understand how to calculate the formula for weekends.

    Ideally i would like the formula to be the same in all Column J, as i will only be pasting the weekdays into Column A.
    Would really appreciate it if someone could have a look and show me where im going wrong, or show me how to improve/simplify it.

    Kind regards, galvinpaddy.
    Attached Files Attached Files
    Last edited by galvinpaddy; 07-21-2012 at 06:30 AM.

  2. #2
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Re: Problem with "IF(OR" within my time sheet.(or perhaps its just too early)

    Ok, i think i sorted it, the formula in J3 for example.
    Please Login or Register  to view this content.
    When i changed it to read
    Please Login or Register  to view this content.
    It appears to work
    Time to test!

    ---------- Post added at 12:51 PM ---------- Previous post was at 11:50 AM ----------

    ok, so i return with another issue,

    If i change my clock in time to 08:00 & my clock out time to 16:30, it produces a weird number format in J (ignore Column I, can be deleted)
    It simply shows up as 1.33227E-15
    Any idea why?

    regards.
    Last edited by galvinpaddy; 07-21-2012 at 07:17 AM.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Problem with "IF(OR" within my time sheet.(or perhaps its just too early)

    its a precision thing although f3=j1 =true
    (f3-j1)*24 = 0.0000000000000013322676
    not zero
    try rounding
    =IF(C3="","",ROUND(IF(OR(A3="Sat",A3="Sun"),G3-H3,F3-$J$1)*24,2))
    alsoyou cant multiply a number by blank or you'll get value error you may want to change
    =IF(C3="","",IF(F3=$J$1,"",F3-$J$1)) to
    =IF(C3="","",IF(F3=$J$1,0,F3-$J$1))
    Last edited by martindwilson; 07-21-2012 at 12:16 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Re: Problem with "IF(OR" within my time sheet.(or perhaps its just too early)

    Hi & thanks for your reply.
    When i add your formula the hours dont seem to calculate properly?
    If i add your formula, then the hours for Sat & Sun remain the same regardless of start finish time??

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Problem with "IF(OR" within my time sheet.(or perhaps its just too early)

    which formula are you talking about? why have you got all those helper columns? another formula that looks wrong is
    =IF(F6="","",IF(A6="Sat",G6-H6,H6*24)) why isn't that =IF(F6="","",IF(A6="Sat",G6-H6,H6)*24)

  6. #6
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Re: Problem with "IF(OR" within my time sheet.(or perhaps its just too early)

    Hi & Thanks for your reply!
    (as in #2 post, Column I can be ignored / deleted)

    The formula you gave me -
    Please Login or Register  to view this content.
    is the one that appears to cause an issue for me. if i use that formula in J3, and fill down, all times calculate accurately apart from the O.T (colum I) for Sat & Sun, regardless of what clock in/out time i enter into Columns B & C.

    Columns B, C, G & H are all time format, D, E & I are all number format (so i can add up the figures shown in K3 & L3.) as i couldnt figure out how to do it without converting time to numbers.

    So far the only way i can get the overtime figure in the 'O.T' column for weekends to show correctly is to change the formula
    From -
    Please Login or Register  to view this content.
    To -
    Please Login or Register  to view this content.
    But i cant figure out why, and ideally i would like to not have to modify the formula in any cell, to make it easier when adding times.

    Thanks for your time so far!
    galvinpaddy (updated sheet added with the irrelevant column removed and you formula added into 'O.T' (I), and
    Please Login or Register  to view this content.
    added into 'OT' (H3) which shows a value error.)
    Attached Files Attached Files
    Last edited by galvinpaddy; 07-22-2012 at 06:16 AM.

  7. #7
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Problem with "IF(OR" within my time sheet.(or perhaps its just too early)

    Try this at H3

    Please Login or Register  to view this content.
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  8. #8
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Re: Problem with "IF(OR" within my time sheet.(or perhaps its just too early)

    Hi, thanks for that, now my issue is getting the Sat & Sun hours to show accurately.
    During the week i need the sheet to show how many hours over my working day are overtime, and on weekends the whole days is OT

    regards, galvinpaddy

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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