Hi all,
I have this sheet where I calculate the daily time worked based on the sum of time intervals and then calculate the time effectively worked against an expected time value. Based on the final result I present, through conditional formatting, the difference in bold red if time worked was less than the expected, black normal if they're equal and bold black if time worked is greater.
For instance:
[Morning time equals the sum of up to 2 intervals)]
N1 = (C1-B1)+(E1-D1)
[Afternoon time equals the sum of up to 4 intervals]
O1 = (G1-F1)+(I1-H1)+(K1-J1)+(M1-L1)
Daily time equals the sum of morning time and afternoon time
P1 = N1+O1
Expected time
Q1
Difference between worked time and expected time
P1-Q1
The problem is that when "apparently" the time worked is equal to the expected time and the subtraction of the 2 shows ZERO, the SIGN function doesn't return ZERO as expected.
First I thought the problem was with the SIGN function so I replaced P1 result with a literal value equal to Q1 and the result of the SIGN function was zero as expected. No problem here.
So the problem must be in the sum of the periods of time. Apparently although:
-the result of the sum shows the same value as Q1 and
-the subtraction of the 2 returns ZERO and
- if I test one value against the other it returns TRUE
they are not exactly the same.
All cells are formatted as "Time" of type "13:30".
I'm running out out of ideas as what can be the origin of this difference. Although I'm not giving up on solving it myself, I have to admit that some help would be appreciated.
Thanks on advance,
ND
Bookmarks