+ Reply to Thread
Results 1 to 8 of 8

Can I make a sum which returns a min value?

  1. #1
    Registered User
    Join Date
    11-07-2010
    Location
    wigan england
    MS-Off Ver
    Excel 2003
    Posts
    8

    Can I make a sum which returns a min value?

    Hello All,

    I need to make a calculation of hours, it needs to return 8.5 hours as a minimum and needs to subtract 1 hour if 9.5 hours are exceeded.


    Column A is start time, column B end time column C is where I need the calculation of A & B with a minimum of 8.5 hours subtracting 1 hour after 9.5 hours have been reached.

    I'm not sure this is even possible to do, it's beyond my limited knowledge but I'd like to learn how to do this.
    Andy

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

    Re: Can I make a sum which returns a min value?

    do you want real time or decimal time?
    =MAX((B1-A1)*24-1,8.5) is a decimal hours value format cell general w.ll give a min of 8.5
    =MAX((B1-A1)*24-1,8.5)/24 will give a min of 8:30
    hmm what if someone does 9.25 hours
    Last edited by martindwilson; 11-24-2012 at 05:03 AM.
    "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

  3. #3
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Can I make a sum which returns a min value?

    Hi ashcrroft752

    If your times are as hh:mm
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-07-2010
    Location
    wigan england
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Can I make a sum which returns a min value?

    Hi All,
    I would need the time retuned in column C to be decimal, so 8 1/2 hours would be 8.5.

    If some one were to do 9.25 hours this should return 8.5

  5. #5
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Can I make a sum which returns a min value?

    Hi ashcrroft752

    If it is "Time" in A1 & A2: =(MAX((B1-A1)-TIME(1,0,0),TIME(8,30,0)))*24

    If it is "Decimal Time" in A1 & A2: =MAX((B2-A2)-1,8.5)

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

    Re: Can I make a sum which returns a min value?

    did you not try
    =MAX((B1-A1)*24-1,8.5)

  7. #7
    Registered User
    Join Date
    11-07-2010
    Location
    wigan england
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Can I make a sum which returns a min value?

    Hi All,

    Both work until the start time is before 00:00 and the end after 00:00, is it possible to make C return nothing if no values are entered in A & B?

  8. #8
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Can I make a sum which returns a min value?

    Then you can use the MOD function for the real time:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And for the Decimal Time:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And to return "nothing". one way might be something along these lines!
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Or
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You can also not show zero's in cells that have a zero value. not sure where this is in excel 2003!
    Last edited by Kevin UK; 11-25-2012 at 12:30 PM.

+ 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