+ Reply to Thread
Results 1 to 9 of 9

Subtracting Times

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Subtracting Times

    I'm trying to find the difference in two different times (generally going to be less than a minute apart) and it works fine from noon to 12:59:59 and then it gives me a #VALUE! error. Before 1pm, the time is shown as mm:ss.0 but then after 1pm, it shows up as hh:mm:ss.000 PM and I think that's what the error is. I've been reformatting these cells trying to get them to be the same but nothing is working.

    Can anyone help me out?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Subtracting Times

    Hi,

    Any chance you could upload the workbook so that we may see in context
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-30-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Subtracting Times

    Correct times.jpg Incorrect Times.jpg
    The one on the left is correct and the one on the right is where I'm having issues. I don't know how to upload the whole workbook or even if I should be (this is for my work so privacy and all that) so hopefully this is good. The times for the correct one go from 7am to 9am and that's working fine. The incorrect one is from 11am to 1pm and I have another with the same issue that's 4pm to 6pm... I thought the last one would work ok since the times appeared to show up the same but I'm still having issues.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Subtracting Times

    It's a little hard to guess when we can't see the subtrahends.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,624

    Re: Subtracting Times

    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced (next to quick post),
    • Scroll down until you see "Manage Attachments",
    • Click that then select "add files" (top right corner).
    • Click "Select Files" find your file, click "open" click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Click "Done" at bottom right to close the Attachment Manager.
    • Click "Submit Reply"
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    07-30-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Subtracting Times

    So there's the workbook I'm using. It seems to me like I need the times after 1pm converted to hh:mm:ss to get this to work but changing the formatting is doing absolutely nothing to get rid of the decimal and everything after that.
    Last edited by Scootman1911; 10-12-2015 at 05:26 PM.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Subtracting Times

    Hi,

    Formatting has nothing to do with this, formatting rarely does since formatting can never change the underlying number.
    Your problem is due to the fact that times after 13:00 (Row A1110 and onwards) are text rather than being numbers. i.e. your data is not consistent and needs correcting. the following formula in D6 copied down is one way

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    but you really would be advised to make sure your underlying data is consistent.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Subtracting Times

    You could fix the input using find & replace.

    Select col A, find " *" (sans quotes), leave the replace box empty, press replace all.

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,624

    Re: Subtracting Times

    Please Login or Register  to view this content.

+ 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] Subtracting two times
    By nicolelschramartin in forum Excel General
    Replies: 2
    Last Post: 12-09-2012, 07:46 PM
  2. Subtracting times
    By lightsandsirens in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-08-2009, 12:48 PM
  3. Subtracting times
    By acuratlmike in forum Excel General
    Replies: 8
    Last Post: 10-06-2009, 02:09 PM
  4. [SOLVED] Subtracting times.
    By in forum Tips and Tutorials
    Replies: 5
    Last Post: 03-10-2006, 12:34 PM
  5. Subtracting times
    By gaftalik in forum Excel General
    Replies: 3
    Last Post: 11-02-2005, 02:45 PM
  6. Subtracting Times
    By bhalchandra2000 in forum Tips and Tutorials
    Replies: 1
    Last Post: 08-23-2005, 12:08 PM
  7. [SOLVED] Subtracting Times
    By NChris in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-10-2005, 06:06 PM
  8. [SOLVED] Subtracting times
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 01-12-2005, 06: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