سؤال

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?

هل كانت مفيدة؟

المحلول

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))

نصائح أخرى

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)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top