Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Want to display -123 as (123) in expressions
Example:
if ((sum(x) + sum(y) +sum(z)) - (sum(x) + sum(y) +sum(k))) < 0
then i want to display (14000) instead of -14000
Any help is appreciated
=Num(14000,'0;(0)') will return 14000
=Num(-14000,'0;(0)') will return (14000)
Or more complete:
=Num(-14000,'# ##0;(# ##0)' , ',' , ' ' ) will return (14 000)
With decimal separator and thousands separator specified as the third and fourth parameter.
i didnt understand how to incorporate it into my expression.
can u plz help me?
Encase your entire expression into fabs() function
=fabs((sum(x) + sum(y) +sum(z)) - (sum(x) + sum(y) +sum(k)))
Regards
MR
ok...but it returns positive digit if it is negative. But I want to show (14000) if it is -14000
So the difference is only brackets?
Try this:
if ((sum(x) + sum(y) +sum(z)) - (sum(x) + sum(y) +sum(k)) < 0, '(' & (sum(x) + sum(y) +sum(z)) - (sum(x) + sum(y) +sum(k)) & ')', (sum(x) + sum(y) +sum(z)) - (sum(x) + sum(y) +sum(k)))
It's ugly but will shows (14000).
Then you simply do this:
=Num( sum(x) + sum(y) + sum(z) - ( sum(x) + sum(y) + sum(k) ) , '0;(0)' )
Dual('('&fabs( yourexpression)&')', yourexpression)
doesnt work for me.
It still gives me negative value.
Hi,
did you try peter suggestion,
There is no need of If statement,
Try like
Num((sum(x) + sum(y) +sum(z)) - (sum(x) + sum(y) +sum(k))),,'# ##0;(# ##0)')
Regards