Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / November 2005

Tip: Looking for answers? Try searching our database.

Dispalying negative times

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Francis Brown - 19 Nov 2005 23:16 GMT
I Have a work sheet with two times in cells A1 and A2 in number format mm:ss.

Cell A3 callculates A2-A1.

If the value is positive is displays with no problem. However negative
values  give ######## in the cell.

I have used the following to resolve.

=IF(A2-A1<0,"-"&MINUTE((A2-A1)*(-1))&":"&SECOND((A2-A1)*(-1)),A2-A1)

Is there a more elagant way to resolve.

Regards and Thanks in advance

Francis,
goober - 19 Nov 2005 23:50 GMT
=IF((A1-B1)<0,(A1-B1)*-1,A1-B1)

or if you want the number to show as a negative

=IF((A1-B1)<0,"-"&(A1-B1)*-1,"-"&A1-B1)

I hope this is what you are looking for.

Signature

goober

Francis Brown - 20 Nov 2005 00:06 GMT
This dosent keep the number format so minus 1 minute comes out as
-0.00416666666666667 on screen.

Thanks for effort. looks like my original thoughs might be the only way to
display in minutes:seconds.

Regards

Francis.

> =IF((A1-B1)<0,(A1-B1)*-1,A1-B1)
>
[quoted text clipped - 3 lines]
>
> I hope this is what you are looking for.
Ron Rosenfeld - 20 Nov 2005 01:42 GMT
>I Have a work sheet with two times in cells A1 and A2 in number format mm:ss.
>
[quoted text clipped - 12 lines]
>
>Francis,

Tools/Options/Calculation
    Workbook Options
     Select:  1904 date system

--ron
Ron Rosenfeld - 20 Nov 2005 02:09 GMT
>>I Have a work sheet with two times in cells A1 and A2 in number format mm:ss.
>>
[quoted text clipped - 18 lines]
>
>--ron

If you don't want to change the date system, and don't mind having a text
string as a result, you could try this formula:

=TEXT(SIGN(E16-E17),";""-"";;")&TEXT(ABS(E16-E17),"[h]:mm")

--ron
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.