+ Reply to Thread
Results 1 to 7 of 7

using logical functions

  1. #1
    Registered User
    Join Date
    05-12-2015
    Location
    Adelaide Australia
    MS-Off Ver
    various
    Posts
    15

    using logical functions

    Hi,

    I'm new here and not sure if this is possible.

    I want to use the logical functions on timesheets to generate break times. i.e. if the shift is longer than 5 hours they get a .5hour break, and if it's less they get 0.
    so I have start time and finish time in separate cells- see attached photo

    but I also wanted to know if it was possible to put a logic function in with a function that calculates total hours, so that it went red if the total hours were more than 8, or less than 4?

    excel example.png

  2. #2
    Forum Contributor
    Join Date
    12-16-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2016 Preview
    Posts
    105

    Re: using logical functions

    The attached spreadsheet might help.

    break and time logic.png


    break and time logic.xlsx

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: using logical functions

    Hi bennadelaidefringe

    next time please post a sample worksheet instead of a picture
    that way anyone trying to answer your question doesn't have to do data entry for you to answer your question and (as your working with time) get all your formatting the same and guess which column your working with

    but to answer your question
    yes you can, use formula would be something like

    assuming this formula is in Column H
    H32 if(H31-H30>5,0.5,"")
    H33 if(H32="",H31-H30,H31-H30-H32)

    2nd part of question use conditional formatting
    https://support.office.com/en-au/art...b-f1951ff89d7f
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    05-12-2015
    Location
    Adelaide Australia
    MS-Off Ver
    various
    Posts
    15

    Re: using logical functions

    Awesome, thanks humdingaling and Habanero Time


    one more question though, I was hoping to have the break time dependent on a separate calculation of the start and finish time, not the total calculation, is that possible?
    I've tried IF((H3-H2)*24)>5,"0.5","0"), but excel didn't like that- see below.

    10-Dec 11-Dec 12-Dec 13-Dec 14-Dec 15-Dec 15-Dec
    start 3:00 PM 9:00 AM 7:44 AM 10:15 AM 6:00 AM 1:00 PM 3:00 AM
    finish 6:30 PM 8:00 PM 3:00 PM 2:45 PM 11:00 AM 1:25 PM 1:25 PM

    TOTAL 3.5 11 7.266666667 4.5 5 0.416666667 IF((H3-H2)*24)>5,"0.5","0")
    0.50 0.00 0.50 0.50 0.00 0.00

  5. #5
    Forum Contributor
    Join Date
    12-16-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2016 Preview
    Posts
    105

    Re: using logical functions

    bennadelaidefringe, it would help to know more details about what you're trying to do.

    One thing I see in your formula is an additional right-parentheses, and you shouldn't need those double-quotes unless you want your data treated like text.

    =IF((H3-H2)*24>5,"0.5","0")

  6. #6
    Registered User
    Join Date
    05-12-2015
    Location
    Adelaide Australia
    MS-Off Ver
    various
    Posts
    15

    Re: using logical functions

    Awesome, that's solved it. Thank you very much.

    Just looking to automate rosters that are used mainly for budgets.

  7. #7
    Forum Contributor
    Join Date
    12-16-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2016 Preview
    Posts
    105

    Re: using logical functions

    Excellent!

+ 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] Logical , functions , on ( IF , AND , OR)
    By The Learner in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-20-2012, 04:30 AM
  2. Confusing two logical functions
    By Digestive in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2011, 10:03 AM
  3. Logical Functions
    By be165 in forum Excel General
    Replies: 3
    Last Post: 09-09-2009, 04:08 AM
  4. [SOLVED] using logical functions
    By civilized_engr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-10-2006, 02:40 PM
  5. [SOLVED] logical functions
    By wiz546 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-01-2005, 12:06 AM

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