+ Reply to Thread
Results 1 to 5 of 5

Thread: if function for time

  1. #1
    Registered User
    Join Date
    12-22-2010
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    64

    if function for time

    Hi

    Please find attached a file for your reference. Basically, the maximum hour is 8 in column C regardless the difference between col A and B. How can i achieve it?

    Thanks
    Attached Files Attached Files
    Last edited by Harrold; 01-27-2012 at 03:29 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    12-03-2009
    Location
    Firenze, Italy
    MS-Off Ver
    Excel 2000 XP
    Posts
    436

    Re: if function for time

    Hi,

    a possibility:

    =MIN(8/24,B1-A1)
    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon below the post.

    Please, mark your thread [SOLVED] if you received your answer.

    Forum rules: http://www.excelforum.com/forum-rule...rum-rules.html

  3. #3
    Valued Forum Contributor
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    895

    Re: if function for time

    please look at attachment
    Attached Files Attached Files
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  4. #4
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,789

    Re: if function for time

    =min(b1-a1,1/3)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    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

  5. #5
    Valued Forum Contributor JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    Japan
    MS-Off Ver
    Excel 2010
    Posts
    779

    Re: if function for time

    Does this do what you are after?

    =MAX(IF((B3-A3)>=8,8*24,B3-A3),8)/24
    Edit: Forget mine, it does not work.
    Last edited by JapanDave; 01-27-2012 at 03:34 AM.
    If you are happy with the answer, please click the Star icon in the below left hand corner.

    Good sites to start learning.

    snb's VBA Help Files
    Jerry Beaucaires Excel Assistant
    J & R Excel Consultancy Services

    How to post code correctly: Correct Code Posting

+ 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.2.0