Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Francis Brown
 
Posts: n/a
Default Dispalying negative times

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,
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
goober
 
Posts: n/a
Default Dispalying negative times


=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.


--
goober
------------------------------------------------------------------------
goober's Profile: http://www.excelforum.com/member.php...o&userid=19838
View this thread: http://www.excelforum.com/showthread...hreadid=486585

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Francis Brown
 
Posts: n/a
Default Dispalying negative times

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.

"goober" wrote:


=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.


--
goober
------------------------------------------------------------------------
goober's Profile: http://www.excelforum.com/member.php...o&userid=19838
View this thread: http://www.excelforum.com/showthread...hreadid=486585


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Dispalying negative times

On Sat, 19 Nov 2005 15:16:02 -0800, "Francis Brown"
wrote:

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,


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


--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Dispalying negative times

On Sat, 19 Nov 2005 20:42:34 -0500, Ron Rosenfeld
wrote:

On Sat, 19 Nov 2005 15:16:02 -0800, "Francis Brown"
wrote:

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,


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


--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
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
Negative Results Denise Excel Discussion (Misc queries) 2 October 7th 05 09:17 PM
Negative Values Only [email protected] Excel Discussion (Misc queries) 1 August 8th 05 08:58 PM
Negative times gavin Excel Discussion (Misc queries) 1 April 9th 05 03:11 PM
How do i enter negative times in Excel & how can they be 'fiddled. stuck! Excel Discussion (Misc queries) 2 April 7th 05 02:05 PM
Negative times gavin Excel Discussion (Misc queries) 8 March 27th 05 02:41 PM


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

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

About Us

"It's about Microsoft Excel"