+ Reply to Thread
Results 1 to 2 of 2

Need a formula to change a negative time to negative decimal

  1. #1
    Registered User
    Join Date
    11-02-2016
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    21

    Need a formula to change a negative time to negative decimal

    Hi,

    I have some data imported from a .csv file. If I import the data in general negative time numbers get a circular reference (i.e they get imported as =-17:50).

    If I import everything as text it displays all the numbers correctly. Now I want to convert the time to decimals. So 08:12 is returned as 8,20 and 34:30 is returned 34,50.
    Normally I would just use =A1*24 to get the decimal value but if the time number is negative this returns #VALUE!

    I found this formula that works (I have no idea exactly what it does but it works)

    =SUBSTITUTE(C2;"-";"")*24*SIGN(LEFT(A2;2)+0)

    This formula does indeed return decimal value from both positive and negative time numbers. Great! But the negative time number is returned as a positive decimal number.

    Anyone have a solution so that I can return a negative decimal value from a negative time value?

    Thanks

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,740

    Re: Need a formula to change a negative time to negative decimal

    =A1*24
    works OK for me for negative times
    have you formatted the cell as general ?
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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. Replies: 9
    Last Post: 04-20-2016, 02:42 AM
  2. Replies: 3
    Last Post: 07-18-2010, 07:26 AM
  3. Negative Time Formula
    By jayclinton in forum Excel General
    Replies: 6
    Last Post: 12-23-2009, 12:13 PM
  4. Negative Time Formula??
    By sjr555 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-04-2009, 12:04 PM
  5. Replies: 5
    Last Post: 05-12-2009, 04:47 PM
  6. formula to change a Negative No to a Positive
    By baggy098 in forum Excel General
    Replies: 10
    Last Post: 12-26-2006, 06:35 PM
  7. Excel Formula Negative/Negative =+%
    By BigDon in forum Excel General
    Replies: 1
    Last Post: 05-31-2005, 09:05 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