+ Reply to Thread
Results 1 to 3 of 3

time difference formula - need fix

  1. #1
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    time difference formula - need fix

    Hi,

    this is my formula for calculating time differences :

    Please Login or Register  to view this content.
    formula works, but It acts very odd when calculating with midnight hours (00:00:00). I have Combobox above start/end cells, which inserts selected time interval in them, and If I select time interval with midnight, formula doesn't calculate.

    But If I select midnight hour manually from drop-down lists of start/end cells, formula works.

    Looks like some problem with time format. How can I fix this ?

    Please take a look at the sample, allready selected midnight from combobox.

    thanks for all help !
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: time difference formula - need fix

    I noticed you're using military time for the data list in the Format Control "Input Range". I simple switched 12:00-00:00 to 12:00-24:00. If you keep your list as is then your interval is referencing "0" which messes with your formula by making your "TRUE" condition execute giving you a 0 answer. When you manually do it you aren't referencing military time so Excel can see the difference and give you the proper interval.

    Formula_time.xls

    Regards
    Last edited by BrownBoy; 05-20-2014 at 07:39 PM. Reason: mess up
    BrownBoy

    If happy, mark "SOVLED" & add to "REP"

  3. #3
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: time difference formula - need fix

    Hi BrownBoy,

    I actually tried that before posting this thread, but It didn't work.

    BUT now I see where I was wrong: in FORMAT cells. Because of hh:mm my VBA code didn't insert 24:00 in cell, but 00:00. Now changing to [h]:mm:ss and 24:00 is entered & everything works

    thanks for help !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula for time difference
    By MyOnion in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-19-2013, 03:13 AM
  2. Time difference formula help
    By gcwozniak in forum Excel General
    Replies: 2
    Last Post: 05-24-2011, 10:08 PM
  3. Military Time Difference formula...Help!
    By upmm019 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 08-06-2009, 08:54 AM
  4. [SOLVED] Need formula to calculate time difference
    By markndawoods in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-13-2006, 11:25 AM
  5. Time Difference Formula
    By MEL79 in forum Excel General
    Replies: 2
    Last Post: 03-11-2005, 05:57 PM

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