ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Zero displayed in place of negative values (https://www.excelbanter.com/excel-discussion-misc-queries/142091-zero-displayed-place-negative-values.html)

TC

Zero displayed in place of negative values
 
Hi

I've been struggling with a couple of formulae, but am not sure if I am
going down the right route.

The first is

If value A-B is positive, return as normal. If value A-B is negative, return
zero

(Is there a simple function for this - rather than write it into a formula
?)

The second is this:

If value is = A and =< B multiply by 2, but if value is B and =<C multiply
by 3

I'm probably just getting the syntax messed up with this one, but any help
would be much appreciated

Thanks

--
Tobit



Dave Peterson

Zero displayed in place of negative values
 
#1.
=max(0,a1-b1)
or
=if(a1b1,a1-b1,0)

#2. Maybe...
=d1*if(and(D1=a1,d1<=b1),2,if(and(d1b1,d1<=c1),3 ,0))

If d1 wasn't between those two limits, then I multiplied by 0.


TC wrote:

Hi

I've been struggling with a couple of formulae, but am not sure if I am
going down the right route.

The first is

If value A-B is positive, return as normal. If value A-B is negative, return
zero

(Is there a simple function for this - rather than write it into a formula
?)

The second is this:

If value is = A and =< B multiply by 2, but if value is B and =<C multiply
by 3

I'm probably just getting the syntax messed up with this one, but any help
would be much appreciated

Thanks

--
Tobit


--

Dave Peterson

Toppers

Zero displayed in place of negative values
 
First ..

=MAX(0,A-B)

Second ...

=IF
(AND(value=A1,value<=B1),value*2,IF(AND(valueB1, value<=C1),value*3,"whatever you want"))

Change 'value' as required

"TC" wrote:

Hi

I've been struggling with a couple of formulae, but am not sure if I am
going down the right route.

The first is

If value A-B is positive, return as normal. If value A-B is negative, return
zero

(Is there a simple function for this - rather than write it into a formula
?)

The second is this:

If value is = A and =< B multiply by 2, but if value is B and =<C multiply
by 3

I'm probably just getting the syntax messed up with this one, but any help
would be much appreciated

Thanks

--
Tobit




TC

Zero displayed in place of negative values
 
Thanks Guys - works well

--
Tobit




All times are GMT +1. The time now is 06:04 AM.

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