+ Reply to Thread
Results 1 to 9 of 9

excel formula question with TIME

  1. #1
    Registered User
    Join Date
    01-16-2018
    Location
    Warner Robins, GA.
    MS-Off Ver
    2013
    Posts
    5

    excel formula question with TIME

    Trying to figure out the changes needed for this formula to display a correct time prior to midnight rather than #####. TIA


    =IF($E$2="","",$E$47-TIME(0,-C15,0))

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: excel formula question with TIME

    Hello and welcome to the forum. Showing us a non-working formula without data or expected outcomes isn't helpful.

    If you expect a good response, please attach a sample workbook making sure there is just enough data to demonstrate your need.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    01-16-2018
    Location
    Warner Robins, GA.
    MS-Off Ver
    2013
    Posts
    5

    Re: excel formula question with TIME

    thanks. will do.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: excel formula question with TIME

    What exactly does "time before midnight" mean? I would expect that it means that the value is negative, and the default 1900 date system cannot display negative times. Some ideas for testing:

    1) Format the cell as general. I would expect it to contain a negative fraction (-0.25 if the result is -6 hours, for example).
    2) If the test from 1 suggests that it is just the inability of the 1900 date/time system to display negative times, then switch to the 1904 date/time system, which is not limited in this way. Be careful with this, though. As a somewhat global setting, if there are other calculations in this spreadsheet or others that depend on the 1900 date/time system, then those calculations will be thrown off.
    3) If you cannot use the 1904 date/time system, then you may need to consider other approaches that either avoid the negative time, or that abandon Excel's built in date/time serial number system.

    Read this if you are unfamiliar with how Excel stores dates/times: http://www.cpearson.com/Excel/datetime.htm
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: excel formula question with TIME

    Perhaps use MOD, e.g.

    =IF($E$2="","",MOD($E$47-TIME(0,-C15,0),1))
    Audere est facere

  6. #6
    Registered User
    Join Date
    01-16-2018
    Location
    Warner Robins, GA.
    MS-Off Ver
    2013
    Posts
    5

    Re: excel formula question with TIME

    Sorry for the lack of... well, anything at all.

    Hopefully, the attached worksheet will help.
    Attached Files Attached Files

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: excel formula question with TIME

    Just add MOD function as I suggested in my last post, in C15 copied down

    =IF($C$2="","",MOD($C$24-TIME(0,-A15,0),1))

  8. #8
    Registered User
    Join Date
    01-16-2018
    Location
    Warner Robins, GA.
    MS-Off Ver
    2013
    Posts
    5

    Re: excel formula question with TIME

    Thanks everyone for the help!

  9. #9
    Registered User
    Join Date
    01-16-2018
    Location
    Warner Robins, GA.
    MS-Off Ver
    2013
    Posts
    5

    Re: excel formula question with TIME

    that was it! thank you very much.

+ 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] Question about time formula with specific conditions
    By lizard54 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-10-2014, 04:25 PM
  2. Date/time formula question.
    By Scootter_DK in forum Excel Formulas & Functions
    Replies: 29
    Last Post: 10-11-2007, 09:25 AM
  3. Another time formula question
    By windme in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-30-2006, 11:10 AM
  4. time formula question
    By David in forum Excel General
    Replies: 6
    Last Post: 06-04-2006, 09:45 AM
  5. Formula TIME question
    By Pharmagirl in forum Excel General
    Replies: 1
    Last Post: 11-14-2005, 05:55 PM
  6. Formula question - time calc
    By Steve Grosz in forum Excel General
    Replies: 5
    Last Post: 07-08-2005, 07:05 PM
  7. [SOLVED] formula question/elapsed time
    By vdefilippo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-14-2005, 02:07 PM
  8. time formula question...
    By Greg in forum Excel General
    Replies: 5
    Last Post: 02-25-2005, 07:06 AM

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