Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Time Difference Between Cells

Status
Not open for further replies.

brent01

Technical User
Jul 11, 2001
32
GB
I have a spreadsheet to complete daily.

I have to enter batch job run timings. I have to calculate run times mentally i.e job1 starts at 11:30 and job2 starts at 11:32, so the run time I would enter = 2 minutes (00:02 is what I would actually enter)

Is there any way of entering the start time for each job in different cells and then have excel calulate the actual differences which would equate to the correct run time?

If this makes sense, could anybody help?
 
Just do Job2time - Job1 time and format the answer cell as a time.
 
If the difference is going to be more than 24 hours, you'll need to format the time as a Custom.

Specify it as [h]:mm

This will allow Excel to go over 24 hours without wrapping back to 00:00

Cheers,
Dave

Probably the only Test Analyst on Tek-Tips

animadverto vos in Abyssus!

Take a look at Forum1393 & sign up if you'd like
 
Thank you, this is pretty much what I want to do..

It works fine. Ideally what I am trying to achieve is having for example -

Job1time in cell (A1) and Job2time in cell (B1)

Calculating B1-A1 and putting the result in cell B1.

I have tried this and Excel is going on about iterations and the cell B1 displays #######.

Any ideas?

Effectively I would like B1-A1 (result in cell B1), C1-B1 (result in cell C1)....


 
You cannot put =B1-A1 in cell B1 because as soon as you do you lose the original contents of B1 and Excel can no longer do the calculation.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Is there any way you could put the run time in a cell in the C column? If so, i would make a cell in I.E. A1 have the start timefor job 1 and in B1 have the start time for job 2. In cell C1 have an equation of "=b1-a1". This would give you the difference of a1 and b1. Sorry if this doesn't help :(
 
Spitaro's suggestion will work for you.
[smile]

Cheers,
Dave

Probably the only Test Analyst on Tek-Tips

animadverto vos in Abyssus!

Take a look at Forum1393 & sign up if you'd like
 

FYI...

Why do Dates and Times seem to be so much trouble? faq68-5827

Skip,

[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top