ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Negative time should be allowed in Excel, eg time difference (https://www.excelbanter.com/excel-discussion-misc-queries/50172-negative-time-should-allowed-excel-eg-time-difference.html)

Bengt-Inge Larsson

Negative time should be allowed in Excel, eg time difference
 
If you want to subtract two time values, it shows error if negative.
It would be an interesting feature e.g. for sports.
Also, allow years before 1900 to be shown.


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc

Bob Phillips

You cater for it

=IF(A1B1,A1-B1,B1-A1)

--
HTH

Bob Phillips

"Bengt-Inge Larsson" <Bengt-Inge wrote in
message ...
If you want to subtract two time values, it shows error if negative.
It would be an interesting feature e.g. for sports.
Also, allow years before 1900 to be shown.


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow

this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.


http://www.microsoft.com/office/comm...lic.excel.misc



Roger Govier

Hi

I think Bob meant
=B1-A1+(A1B1)*24
assuming Finish Time in B1 and Start time in A1

The formula posted will return 10:00 hours in both cases where A1=23:00
and B1=13:00, and A1=13:00, B1=23:00
as opposed to 14:00 hours and 10:00 hours respectively.

or you could use the less intuitive
=MOD((B1-A1),1)

Regards

Roger Govier



Bob Phillips wrote:

You cater for it

=IF(A1B1,A1-B1,B1-A1)





All times are GMT +1. The time now is 09:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com