Formatting Negative times

D

Don

I'm trying to display the difference in the amount of time
I exercise from month to month. Sometimes, it's
negative. using a formula in EXCEL:
=IF(AND(ISNUMBER(Q3),ISNUMBER(C3),C3>0,Q3>0),IF((T3-F3)
0,TEXT((T3-F3),"m:ss"),TEXT(-(T3-F3),"-"&"m:ss")),""), it
works fine (the cells are in excel time, days). When I
write a macro to do the same thing using:
Cells(r, SumTAvgCol + DColD) = Format(-a, "-" & "mm:ss")
I get -12:26. Always 12 as the minutes. If I use:
Cells(r, SumTAvgCol + DColD) = Format(-a, "h:mm:ss") It
works correctly.

Huh?

Thanks,
Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top