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

Time Calculation

Status
Not open for further replies.

robcarr

Programmer
May 15, 2002
633
GB
Dear All,

I am trying to calculate the different lengths of time between 2 times, 12:00 - 16:00 = 4:00, the formula I am using is very simple =b1-a1, (12:00 in a1, 16:00 in b1), c1 has answer, this works fine on 95% of the calculations, when i have a time that finishes at 00:00(or later 00:01 etc) the formulas displays ####### in the cell, no other data is in the cell apart from this result, how can I get around this and calculate the 00:00 correctly.

Thanks in advance.
 
it has nothing to do with the size of the cell, it is because of the 00:00 time in one of the cells that is calculated.
 
sorry,

you are getting ####### because the result of the calculation is a negative number

try

=IF(B2-A2<0, B2-A2+1, B2-A2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top