PC Review


Reply
Thread Tools Rate Thread

How can I handle negative time values?

 
 
=?Utf-8?B?ZGtub3J3b29k?=
Guest
Posts: n/a
 
      9th Jul 2007
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

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

Any help would be most appreciated. I can definitely get the calaulation to
run ok, but I have not yet found a way to format the result in the desired
fashion.

dknorwood
 
Reply With Quote
 
 
 
 
Ron Rosenfeld
Guest
Posts: n/a
 
      9th Jul 2007
On Sun, 8 Jul 2007 18:54:00 -0700, 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
>
>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
>
>Any help would be most appreciated. I can definitely get the calaulation to
>run ok, but I have not yet found a way to format the result in the desired
>fashion.
>
>dknorwood


If you can live with it:

Tools/Options/Calculations

Under Workbook Options SELECT the 1904 Date system.

Then format as mm:ss (or perhaps [h]:mm:ss.0) depending on how much precision
you wish to display.

This will change dates already entered in this workbook by 4 years (and a day),
but will allow you to display negative times.

Otherwise you would only be able to display the value as a text string -- that
would make further mathematical operations difficult. You might be able to get
around this issue by using hidden cells for the actual result, and visible
cells for the displayed result.
--ron
 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      9th Jul 2007
You can use the 1904 date system to display negative time, however, this
will affect any dates you already have entered in your file. They will be
off by 4 years (1462 days). This can be a significant drawback! You can fix
this side effect but it may not be worth the trouble.

Tools>Options>Calculation>1904 date system

Then you'd have to subtract 1462 days from the dates that changed.

Other options:

Use decimal values instead of time formatted values.
You can display a negative time as TEXT but this may affect any downstream
calculations.

--
Biff
Microsoft Excel MVP


"dknorwood" <(E-Mail Removed)> wrote in message
news:9AA1BE49-CD84-40F2-B134-(E-Mail Removed)...
>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
>
> 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
>
> Any help would be most appreciated. I can definitely get the calaulation
> to
> run ok, but I have not yet found a way to format the result in the desired
> fashion.
>
> dknorwood



 
Reply With Quote
 
Harlan Grove
Guest
Posts: n/a
 
      9th Jul 2007
"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")


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
negative time values MerryMike Microsoft Excel Discussion 0 30th Nov 2007 08:11 PM
how do i sum up a column of time values but ignore negative values =?Utf-8?B?Q3JvbGw=?= Microsoft Excel New Users 1 11th Oct 2005 05:55 PM
Negative Time Values B. Baumgartner Microsoft Excel Misc 1 1st Jul 2005 10:16 AM
Re: Negative time values Gord Dibben Microsoft Excel Worksheet Functions 0 5th Feb 2004 11:43 PM
Negative time values Matthew Wunder Microsoft Excel Worksheet Functions 1 26th Nov 2003 10:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:15 PM.