+ Reply to Thread
Results 1 to 4 of 4

Negative time, hours

  1. #1
    Registered User
    Join Date
    07-21-2016
    Location
    London, Englan
    MS-Off Ver
    2007
    Posts
    2

    Negative time, hours

    If anyone can help it would be much appreciated.
    I have created a toil spreadsheet with two columns. column A and B with rows consisting of hours (time) with both columns having a total at the bottom (let’s say in row A21 and B21) In C21 I am trying to subtract B21 (hours used) from A21 (hours accrued) but if the used is greater than the accrued then C21 becomes a negative and all I get are hash tags !!

    How can I get C21 to read as hours now owed to the company and to put a negative sum ( eg, minus 3 hours )

    Also .... I cannot go over 24 hours accrued or used as it sees it as a clock not actually chunks of time, so it goes back to 00:00. I need to be able to add up someone’s toil and they might have accrued 27 hours ?? ... Please advise

    Thank you

    Jacks

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Negative time, hours

    Welcome to the forum.

    The second question is the easiest to answer: format your time cells using the custom format [h]:mm and the hours will add up to as many as you need, not reset at 24.

    Getting negative numbers to display is a bit more problematic, but possible. First, use this formula in C21 - it will display the number of hours owed or accrued as a positive number, regardless of whether the result actually is positive or negative:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Now, go to Conditional Formatting ('Home tab', 'Styles' section), click 'New Rule' then 'Use a formula to determine which cells to format'. Enter this in the formula box:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Now click the 'Format' button, go to the 'Number' tab, select 'Custom' on the left-hand side, then enter this in the 'Type' box on the right:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This will force positive hrs:mins to display as red hrs:mins with a minus sign, and negative numbers and zeros to not have a minus sign (the @ at the end tells it to accept text as typed).

    Does that do what you want?
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Registered User
    Join Date
    07-21-2016
    Location
    London, Englan
    MS-Off Ver
    2007
    Posts
    2

    Re: Negative time, hours

    OMG .... You are amazing, Thank you

    It worked perfectly!

    I have been trying for months to sort this out, and you were able to help me straight away .... I really am impressed, and I thank you

    Jacks

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Negative time, hours

    You're welcome - thanks for the feedback.

    So that others know there's a solution here, please mark this thread as [Solved] by going to 'Thread Tools' above your first post and selecting 'Mark this Thread as Solved' - thanks.

+ 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] Timesheet that calcs time in, time out, lunch used, reg hours, ot hours, double hours
    By noobface in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-21-2021, 03:45 AM
  2. Replies: 5
    Last Post: 03-18-2015, 11:31 PM
  3. [SOLVED] TextBox - Display hours greater than 24 and negative hours too.
    By gnaske in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-21-2014, 03:01 PM
  4. Working with time in hours; how can i get a negative or total value?
    By smithjon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-22-2013, 04:38 PM
  5. [SOLVED] More grief over Hours v TIME- Negative hours
    By wyndland in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-25-2013, 11:49 AM
  6. [SOLVED] how do i show negative time in hours minutes
    By john tyler in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-06-2006, 04:50 PM
  7. [SOLVED] How to show negative time (e.g. -10 hours)
    By Arhippa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-19-2005, 05:06 AM

Tags for this Thread

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