+ Reply to Thread
Results 1 to 7 of 7

Formula for time difference

  1. #1
    Registered User
    Join Date
    06-17-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    31

    Question Formula for time difference

    Hey... Its me again... with problems about time again...


    What I am doing now is calculating time differences...
    So...
    1) Column A reflects the start time,
    2) Column B reflects the end/stop time,
    3) Column C reflects the time difference (B-A),
    4) Column D reflects the target time.

    What I wanted is that, if the difference is more than the target time, the cell would be colored red, which I succeed in doing through condition formatting.
    On the other hand, if the target time is equal or larger than the time difference, the cell would be colored green, which I succeed in doing that too.

    However, since "0:00" is for time difference is technically smaller than target time, the cell is colored green (which is not what I wanted).
    Therefore, I was wondering if anyone can come up with a formula whereby if D>=C and that cell is more than 0, the cell would become green.


    Short request:
    Merge "D equal or more than C" and "C more than 0".
    Please make it easy for me to understand! Limit?!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,051

    Re: Formula for time difference

    =AND(D>=C, C>0, C<>"")


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formula for time difference

    So it's me again... that i have to ask for you to upload a small sample workbook as Times format is a little "strange" issue in Excel.


    To attach a small sample workbook.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

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

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    06-17-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Formula for time difference

    Thanks guys!

    TMS's solution works fine for me.
    Though I only use the "=AND(D>=C, C>0)". Not sure what does "C<>" do.

    Thanks Fotis too, though I don't need to upload a sample I guess. Will start a new thread if something happens again.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,051

    Re: Formula for time difference

    You're welcome.

    It checks that the value isn't blank.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formula for time difference

    Quote Originally Posted by MyOnion View Post

    Thanks Fotis too, though I don't need to upload a sample I guess..
    I guess too!!

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,051

    Re: Formula for time difference

    Thanks for the rep.

+ 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. Time difference formula help
    By gcwozniak in forum Excel General
    Replies: 2
    Last Post: 05-24-2011, 10:08 PM
  2. Military Time Difference formula...Help!
    By upmm019 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 08-06-2009, 08:54 AM
  3. [SOLVED] Need formula to calculate time difference
    By markndawoods in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-13-2006, 11:25 AM
  4. How can I use a time difference in a subsequent formula in Excel?
    By Niek Otten in forum Excel Formulas & Functions
    Replies: 31
    Last Post: 09-06-2005, 11:05 AM
  5. Time Difference Formula
    By MEL79 in forum Excel General
    Replies: 2
    Last Post: 03-11-2005, 05:57 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