Consulting

Results 1 to 4 of 4

Thread: Solved: finding the difference in time

  1. #1

    Solved: finding the difference in time

    hello all,

    columns a stores the start time, column b stores the end time. i would like column c to show the difference between the times. there are no dates in any of the columns and i am running into negative time issues because column b is sometimes after midnight and column a is before. what would be the correct formula to put in column c ?

    thanks in advance!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    =MOD(B1-A1,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

  3. #3
    thanks!
    can you please explain the mod function and variables?

    thanks again!

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Returns the remainder after number is divided by divisor. The result has the same sign as divisor.

    The critical thing is that MOD effectively subtracts the divisor multiplied by the integer portion of the number divided by the divisor from the number. So Mod(1.3, 1) is .3, but Mod(-1.3, 1) is .7.
    ____________________________________________
    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

Posting Permissions

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