+ Reply to Thread
Results 1 to 5 of 5

Subtracting times / Converting to Min

  1. #1
    Forum Contributor
    Join Date
    04-02-2008
    Location
    Jacksonville Beach, Florida
    MS-Off Ver
    Microsoft Excel 2003 and 2010
    Posts
    264

    Subtracting times / Converting to Min

    I wrote a formula that subracts to times and gives me minutes (example below):

    For 23:34 (Row d) and 23:39 (row F) the answer is five min using the following formula:

    =IF(F5790>0,IF(D5790>0,(F5790-D5790)*1440," ")," ")

    But when the clock strikes 12 am at night, 1440 must be added to this formula or you get an error. So the forumla below gives an error for times like 23:53 (Row d) and 0:03 (row F), but I manually sort and fix these errors by using this forumla:

    =IF(F6832>0,IF(D6832>0,(F6832-D6832)*1440," ")," ")+1440

    The answer is 10 min.

    How can I combine these formulas to be more efficient?

    JPD

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Perhaps?

    Please Login or Register  to view this content.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    04-02-2008
    Location
    Jacksonville Beach, Florida
    MS-Off Ver
    Microsoft Excel 2003 and 2010
    Posts
    264

    Perfect

    It is always you who helps me. Thanks.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Actually... this is better... it avoids the #VALUE! error if both fields blank.... and looks better.
    Please Login or Register  to view this content.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,700
    Here's another way.....

    =IF(COUNT(D5790,F5790)=2,MOD(F5790-D5790,1)*1440,"")

+ 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