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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate difference of time

Status
Not open for further replies.

torf66

Programmer
Jun 10, 2003
43
0
0
US
I have two cells that have time in them. I want to be able to calculate the difference between the values.
For example cell A1 has 14:45 in it and cell B2 has 15:10 in it. I want to subtract the difference and return a value in cell A3 of 25minutes. How can this be done in Excel?
Thanks,
Todd
ttorfin@dakcl.com
 
Hi,

[tt]
=B2-A1
[/tt]
format cell as time.

Skip,
[sub]
[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue][/sub]
 
or in vba
Code:
with [a3]
  .value = [b2]-[a1]
  .numberformat = "hh:mm"
end with


Skip,
[sub]
[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top