Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Time Span calculations

Cell A1 ~ 09:00 (Plan arrival time)
Cell A2 ~ 09:15 (Actual Arrival Time)
Cell A3 ~ 0:15 (Late by 15Min)

The above tells the timing for arriving to work and schedule to arrive to
work. The calculation would be showing as such;
ABS(A2-A1)=A3

My problem is, how do we get a negative. for example if
Cell A1 ~ 09:00
Cell A2 ~ 08:55
This will tells that the arriving time is earlier by 5Min which should give
-5min. how do I get a formula for such?

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Time Span calculations

Jafferi

Excel cannot display negative times. To display them in text format, you can
use the below formula; but cannot be used for any calculations..

=IF(A2A1,"+" &TEXT(A2-A1,"hh:mm:ss"),"-"&TEXT(ABS(A2-A1),"hh:mm:ss"))

If this post helps click Yes
---------------
Jacob Skaria


"Jafferi" wrote:

Cell A1 ~ 09:00 (Plan arrival time)
Cell A2 ~ 09:15 (Actual Arrival Time)
Cell A3 ~ 0:15 (Late by 15Min)

The above tells the timing for arriving to work and schedule to arrive to
work. The calculation would be showing as such;
ABS(A2-A1)=A3

My problem is, how do we get a negative. for example if
Cell A1 ~ 09:00
Cell A2 ~ 08:55
This will tells that the arriving time is earlier by 5Min which should give
-5min. how do I get a formula for such?

Thanks in advance!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default Time Span calculations

You can test for - which one is the earlier time and have your calcualtions
accordingly... something like

=IF(A1<A2,A2-A1,-(A1-A2))

"Jafferi" wrote:

Cell A1 ~ 09:00 (Plan arrival time)
Cell A2 ~ 09:15 (Actual Arrival Time)
Cell A3 ~ 0:15 (Late by 15Min)

The above tells the timing for arriving to work and schedule to arrive to
work. The calculation would be showing as such;
ABS(A2-A1)=A3

My problem is, how do we get a negative. for example if
Cell A1 ~ 09:00
Cell A2 ~ 08:55
This will tells that the arriving time is earlier by 5Min which should give
-5min. how do I get a formula for such?

Thanks in advance!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Time Span calculations

By default, Excel for Windows doesn't display negative times/dates. If you
tried it then you noticed the result of the formula was a bunch of ####
symbols.

You can change a setting so that it will display negative times/dates *but*
changing this setting will cause any current dates you have entered in your
file to be off by 1461 days. For example, if A1 contained the date 1/1/2009
then you changed the date setting the date in A1 will now be 1/2/2013. For
this reason I would reccomend not changing this setting. Unless you really
know what you're doing, changing this setting can cause a lot of unforeseen
problems.

Having said all that...

You can display the negative time in a TEXT format. That means it won't be a
true numeric time value if you need to do further calculations on the result
of the formula.

A1 = 9:00 AM
A2 = 8:55 AM

=TEXT(ABS(A2-A1),IF(A2-A1<0,"-","")&"h:mm")

Returns: -0:05 as a TEXT string

--
Biff
Microsoft Excel MVP


"Jafferi" wrote in message
...
Cell A1 ~ 09:00 (Plan arrival time)
Cell A2 ~ 09:15 (Actual Arrival Time)
Cell A3 ~ 0:15 (Late by 15Min)

The above tells the timing for arriving to work and schedule to arrive to
work. The calculation would be showing as such;
ABS(A2-A1)=A3

My problem is, how do we get a negative. for example if
Cell A1 ~ 09:00
Cell A2 ~ 08:55
This will tells that the arriving time is earlier by 5Min which should
give
-5min. how do I get a formula for such?

Thanks in advance!



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Time Span calculations

Hi,

If you only want minutes displayed then

=1440*(A2-A1)

and format the cell to the custom format

General "Min"

Format, Cells, Number tab, Custom.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Jafferi" wrote:

Cell A1 ~ 09:00 (Plan arrival time)
Cell A2 ~ 09:15 (Actual Arrival Time)
Cell A3 ~ 0:15 (Late by 15Min)

The above tells the timing for arriving to work and schedule to arrive to
work. The calculation would be showing as such;
ABS(A2-A1)=A3

My problem is, how do we get a negative. for example if
Cell A1 ~ 09:00
Cell A2 ~ 08:55
This will tells that the arriving time is earlier by 5Min which should give
-5min. how do I get a formula for such?

Thanks in advance!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
claculating time span Julie Excel Worksheet Functions 1 March 1st 08 01:17 AM
Counting if Something Occurred During a Time Span Daren Excel Worksheet Functions 0 September 20th 07 07:06 PM
Inconsistent excel 2007b2 time calculations that span whole days Alex Thomas Excel Discussion (Misc queries) 2 September 20th 06 03:51 AM
Dividing a time span into shifts - overlapping days Heidi Excel Worksheet Functions 17 February 28th 06 01:40 AM
Time Span mrbalaje Excel Discussion (Misc queries) 6 June 16th 05 11:34 PM


All times are GMT +1. The time now is 10:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"