Consulting

Results 1 to 6 of 6

Thread: Solved: easy time formula

  1. #1
    VBAX Regular
    Joined
    Mar 2008
    Posts
    90
    Location

    Smile Solved: easy time formula

    hello,

    what formula I need to use If :

    A2=18:00 (for example 18:00 of 24/10/2010)
    B2= 01:00 (01:00 of 25/10/2010)

    and I want B2-A2=07:00

    thanks!!

  2. #2
    VBAX Mentor
    Joined
    Jun 2004
    Posts
    363
    Location
    If you want to be able to use the result in other formulas, use a custom cell format of hh:mm;@

    If you only want to display the result, as a string and not a time, you can use:
    =TEXT(B2-A2,"hh:mm")

  3. #3
    VBAX Regular
    Joined
    Mar 2008
    Posts
    90
    Location
    note this so operator A log in at 18:00 ...and hewill log off at 01:00 AM the next day... so he stays at work 7 hours... A2=18:00 ... B2=01:00 ... and in c2 i want a formula wich result should be 07:00.

  4. #4
    VBAX Mentor
    Joined
    Jun 2004
    Posts
    363
    Location
    Try this formula:
    =IF(B2-A2<0,1+(B2-A2),B2-A2)

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by mbarron
    Try this formula:
    =IF(B2-A2<0,1+(B2-A2),B2-A2)
    =MOD(B2-A2,1)
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    VBAX Regular
    Joined
    Mar 2008
    Posts
    90
    Location
    thanks guys!!

    have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •