Question

I have a formula:

=IF(B5>0.5,MROUND(D4*$F$2*3,100), MROUND(D4*$F$2*-1,100))

The problem is here:

MROUND(D4*$F$2*-1,100)

D4*$F$2 is always positive, but MROUND gives me #NUM! because the result of D4*$F$2*-1 is always negative.

How can I round negative numbers to the nearest 100?

Was it helpful?

Solution

Yes that it always positive, the negative number comes from the D4*$F$2*-1 calculation

try this one

=IF(B5>0.5,MROUND(D4*$F$2*3,100), -1*MROUND(D4*$F$2,100))

OTHER TIPS

For rounding to powers of 10 you can use ROUND function, i.e.

=ROUND(D4*$F$2,-2)

To add your positive/negative you can then do this to avoid repetition

=IF(B5>0.5,1,-1)*ROUND(D4*$F$2,-2)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top