AD_Taylor
Well-known Member
- Joined
- May 19, 2011
- Messages
- 687
I am using the formula:
to split a column that contains a cumulative total of seconds into days, hours, minutes and seconds.
This works perfectly when the number of seconds is positive, however, on this timesheet the number of seconds can be negative, for example if the user has worked under their allocated hours and needs to make the time up.
In this case the formula produces strange results such as showing the days as '-1' when there are in fact 0 days. There are still negative hours and minutes though.
Also the hours and minutes are calculating as if they were positive still, i.e. adding on 12 mins to 40 mins becomes 52 mins rather than the 28 it should be if the figures were negative.
Can anybody helps sort this out, please?
Thanks in advance,
Adam
Code:
=(INT(1/86400*U6) ) &" day(s), "& INT(MOD(U6, 86400)/3600) & " hour(s), " & INT(MOD(U6, 3600)/60) &" minutes, " & MOD(U6, 60) &" seconds"
This works perfectly when the number of seconds is positive, however, on this timesheet the number of seconds can be negative, for example if the user has worked under their allocated hours and needs to make the time up.
In this case the formula produces strange results such as showing the days as '-1' when there are in fact 0 days. There are still negative hours and minutes though.
Also the hours and minutes are calculating as if they were positive still, i.e. adding on 12 mins to 40 mins becomes 52 mins rather than the 28 it should be if the figures were negative.
Can anybody helps sort this out, please?
Thanks in advance,
Adam