Forum Home
Press F1
 
Thread ID: 66874 2006-03-09 20:10:00 Excel Query tk0102 (9953) Press F1
Post ID Timestamp Content User
437039 2006-03-09 20:10:00 Greet's all, I'm trying to get a cell that contains a simple =(A1-A2) formula to always display a positive (i.e. >0) result, regardless of whether the value in A1 is larger than A2 or not. e.g. if the cell is displaying "-20" I'd like it to just display "20". Any ideas? Thanks.
PS I'm not too up with the play on Excel formulas, as if you couldn't tell... :)
tk0102 (9953)
437040 2006-03-09 20:22:00 You can right-click on the cell and goto Format cells. Choose Number from the category list and set the decimal places to 0. Choose the second option under Negative numbers as this will not display the - sign. The number will be displayed in red though to let you know that it is a negative number. CYaBro (73)
437041 2006-03-09 20:27:00 Thanks for the prompt reply CYaBro. So easy when you know how, huh!? :) tk0102 (9953)
437042 2006-03-10 00:16:00 An alternative method is to use the absolute formula which discards the sign altogether. For example your formula would be =ABS(A1-A2).

This would be useful if you then have to do some calculation on the resulting value and only want a positive number. The other method suggested is purely hiding the negative sign.
odyssey (4613)
437043 2006-03-10 03:05:00 Sorry CYaBro, but odyssey has hit the nail with what I was looking for here. I actually ended up going OTT and using (dont laugh now) :
=IF(A1>B1, A1-B1, B1-A1)
Well, okay, I'm a newbie - you can laugh all you want. :)
Thanks heaps folks. Awesome...
tk0102 (9953)
437044 2006-03-10 03:17:00 I take it that this is for Profit and Loss accounts in the New Accounting, as used in Enron's accounts, audited by Arthur Anderson. "It doesn't matter whether money is coming in or going out, it's all money." :2cents: ;) Graham L (2)
1