+ Reply to Thread
Results 1 to 13 of 13

entering a minus time value into a cell

  1. #1
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    entering a minus time value into a cell

    Confusing title! I've nearly finished (with the help from forumites) my daughters timesheet.
    The problem is cell N2. They use flexitime and some weeks they go into negative hours or minutes. This isn't a problem when doing calculations but when they first use this timesheet, they will need to transfer theiir records over from paper. The cell for the flexitime is N2 and this could be for example -3:05. but when I enter the minus sign before the time -3:05 it thinks it is a formula and won't accept it. Any ideas.
    Thanks
    Attached Files Attached Files
    Last edited by nje; 08-05-2010 at 11:03 AM.

  2. #2
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: entering a minus time value into a cell

    You can enter it as a decimal value, rather than a time value. 3:05 is the same as 0.128472222222222

    So, just enter -0.128472222222222 and confirm and it should be alright.

    To get the decimal value, simply enter the time as a positive value. Change the format of the cell to general. Then just throw in a negative symbol in the front and confirm. Then reapply the time format.

  3. #3
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: entering a minus time value into a cell

    Thanks Whizbang ,I've surprised myself by actually following your instructions and gettng it to work. I appreciate your help but, it won't be just my daughters' times being entered and with lots of different times it could get confusing working out the decimal values.

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: entering a minus time value into a cell

    Hi,

    You could just use another cell (formatted as General) and refer to N2
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  5. #5
    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: entering a minus time value into a cell

    You/she can just enter it as =-"3:05" and format as General or Number
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: entering a minus time value into a cell

    The 1904 date system allows negative times. Just be careful that switching to it part way through creating a worksheet will alter any dates that you already have in the workbook.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  7. #7
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: entering a minus time value into a cell

    Thanks everyone, still trying but not there yet - I've tried the decimal way, thats a bit longwinded, I've tried entering =-"3:05" and that returns 0,13 in the cell. - Oldchippy, I tried refering another cell and formatting as general but it still required decimal input unless I've misunderstood you.
    Domski, thanks I already have the worksheet dated with the 1904 system
    The solution:
    I've just tried using the time as text 00\:00 which works but then G18 can't translate it as time. So the solution is I think, getting cell G18 to translate the time from N2 (text) into [h]:mm any ideas?

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: entering a minus time value into a cell

    If per you sample you're using 1904 date system and enter -"3:05" or =-TIME(3,5,0) the cell should display accordingly if format as Time.

    Not quite sure what the problem is - perhaps you could post a further example ?

    If you have reverted to 1900 date system then you can not format a negative number as Time without converting to text string.
    For ex -0.5 is -12 hours you just can't format as Time - remember that the format is just a mask so you can calculate using -0.5 without issue.

  9. #9
    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: entering a minus time value into a cell

    I've tried entering =-"3:05" and that returns 0,13 in the cell.
    You can format to show as many decimals as you like; the underlying value is correct.

  10. #10
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: entering a minus time value into a cell

    DonkeyOte, Thank you, you are right, -"3:05" does do it correctly, I think I must have used the wrong format. the reason I was using 00\:00 was because of the simplicity of entering it without having to use the colon, but your method solves the problem. Thank you.

  11. #11
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: entering a minus time value into a cell

    Hi,

    How about this one?
    Attached Files Attached Files

  12. #12
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: entering a minus time value into a cell

    Quote Originally Posted by nje View Post
    Domski, thanks I already have the worksheet dated with the 1904 system
    Sorry, didn't actually look at your sample

  13. #13
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: entering a minus time value into a cell

    Oldchippy, That's excellent problem solving, I'm going to use that, I wouldn't have come up with that in a million years. Thanks very much

+ 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