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

I have a table like this (the C column is blank):

     A          B           C

1  19:30      23:00       (3.50)

2  14:15      18:30       (4.25)

I need to calculate the time difference in each row between column A and column B (always B - A), and put it in column C as a decimal number (as shown inside the parentheses).

Which formula should I use? Is it possible to generate a general formula, so I won't have to change the row number every time (maybe INDIRECT)?

share|improve this question
up vote 10 down vote accepted

If you use MOD that will also work when the times cross midnight, e.g. in C2


copy formula down column and the row numbers will change automaticaly for each row

share|improve this answer
+1 - why have I never thought of that!!! – Peter Albert Feb 24 '13 at 21:46

This will do the job:


You might need to format the cell as number, not time!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.