"dknorwood" <(E-Mail Removed)> wrote...
>I have a spread sheet that I use for time comparisons on a project. There
>are target and actual times that get compared. I want to be able to show
>the
>resulting difference as a positive or negative value. For example:
>
>Target Time: 9:00 AM
>Actual Time: 9:01:25 AM
>
>I would like to be able to show tha result as + 01:45
That should be + 1:25.
>I also need to account for the other situation as well:
>
>Target Time: 9:00 AM
>Actual Time: 8:58:25 AM
>
>I would like thsi result to show as - 01:35
....
If you don't want to change your date base from 1900 to 1904, you could
achieve this using text formulas, specifically,
=IF(TargetTime<=ActualTime,"+ ","- ")
&TEXT(MAX(TargetTime,ActualTime)-MIN(TargetTime,ActualTime),"[m]:ss")
If you then need to sum these time difference values, which I'll assume are
in a range named Delta, and display the result in the same format, try
=IF(SUMPRODUCT(2-FIND(LEFT(Delta,1),"- +"),-MID(Delta,3,12))>0,"+ ","- ")
&TEXT(ABS(SUMPRODUCT(2-FIND(LEFT(Delta,1),"-
+"),-MID(Delta,3,12))),"[h]:mm")
|