Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
calculate time differences in excel 2003

i have a goal of 2h47m00s minutes per month. if i attend let say 1h20m00s and when my excel cell format is [Red]-[m]:ss;[Blue][m]:ss it gives me in red color 87 minutes time difference before i reach my goal. When it's negative it gives me the right answer. But if i reach 3h00 normally it should give me 13 minutes colored blue, but it doesn't. It gives me ################# as an answer. Can someone help me get the right formula. Thanx And its not a problem of widening the cell.

share|improve this question

marked as duplicate by ChrisF, Arjan, BinaryMisfit Jan 12 '10 at 22:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Dup of… – WireGuy Jan 10 '10 at 12:49
@mary, this is not too new. Please read the FAQ (and continue at your previous question; it has an "edit" option if required). Thanks! – Arjan Jan 12 '10 at 21:00

Say you want to record your jogging times and set yourself an objective of 2h47 hours of jogging per month (you are a precise person).

You'll need a few cells...

  • Cell A1 (let's call it Goal).

Type in 2:47, which is your objective jogging time. The cell is going to take a custom format of h:mm, for hours:minutes, but in reality excel stores any "time" as a date and time value. In this case, January 1st, 1900, 2:47 AM, but we don't care about that. Although convenient when keying in your data, we will need to take that into account when doing our formula.

  • Cell A2 (let's call it Achieved)

Type in this formula: =SUM(C1:C50). This is a total of all your jogging times that you are going to enter during your month in the column C. There's no problem in adding positive datetimes, since they will never get below zero.

  • Cell A3 (let's call it MonthDifference)

Here's the catch. The excel help under the article "Present the result based on a single time unit" suggests:

=INT((B2-A2)*24) Total hours between two times (4)

=(B2-A2)*1440 Total minutes between two times (295)

=(B2-A2)*86400 Total seconds between two times (17700)

I've picked minutes, as timing jogging seconds might be a bit excessive. In A3, just type =(A2-A1)*1440. Then set your A3 cell custom format to this: [Red]-0;[Blue]0.

Voilà! Now you just have to go run outside and come back to write your times in cells C1 to C50. Good luck.

share|improve this answer
I guess this is the same as your answer at the duplicate? – Arjan Jan 12 '10 at 20:59
(+1 at the other question) – Arjan Jan 12 '10 at 21:18