Bruno,
Without meaning to be critical, your formula *appears* to return the correct
answer when you have, for example, 23:30 in A1 and 01:30 in A1 you get 02:00
However, if you format the cell as General you will see that the actual
value held in the cell is 23.083333333 which is 2 am on January 23 1900.
The reason is the use of 24 in your formula. Excel is taking it as 24 days
*not* 24 hours. The answer is to replace the 24 with 1 (day) as in:
=(A2<A1) * (1- A1 + A2) + (A2 >= A1) * (A2 - A1)
Shorter ways of doing the same thing:
=A2-A1+(A2<A1)
or
=MOD(A2-A1,1)
Neither of which are my original formulas
--
HTH
Sandy
In Perth, the ancient capital of Scotland
[email protected]
[email protected] with @tiscali.co.uk