ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Rounding formulas for negative numbers (https://www.excelbanter.com/excel-worksheet-functions/107991-rounding-formulas-negative-numbers.html)

Pat

Rounding formulas for negative numbers
 
I'm trying to round a negative number with the functions floor and ceiling
but I don't get the expected value.
In italian version for floor() and ceiling():
ARROTONDA.DIFETTO(-4,2;-0,5) gets -4
ARROTONDA.ECCESSO(-4,2;-0,5) gets -4,5
instead of -4,5 and -4.
Can someone help me?
Thanks in advance
Patrizia





[email protected]

Rounding formulas for negative numbers
 

Pat wrote:
I'm trying to round a negative number with the functions floor and ceiling
but I don't get the expected value.
In italian version for floor() and ceiling():
ARROTONDA.DIFETTO(-4,2;-0,5) gets -4
ARROTONDA.ECCESSO(-4,2;-0,5) gets -4,5
instead of -4,5 and -4.
Can someone help me?
Thanks in advance
Patrizia


Hi Patrizia,

Take for your "ARROTONDA.ECCESSO":
=-ARROTONDA.DIFETTO(-A1;0,5)

And for your "ARROTONDA.DIFETTO":
=-ARROTONDA.ECCESSO(-A1;0,5)

if your numbers are negative and write 4,2 into cell A1.

Regards,
Bernd


Bob Phillips

Rounding formulas for negative numbers
 
To quote help

FLOOR

Regardless of the sign of number, a value is rounded down when adjusted away
from zero. If number is an exact multiple of significance, no rounding
occurs

CEILING

Regardless of the sign of number, a value is rounded up when adjusted away
from zero. If number is an exact multiple of significance, no rounding
occurs

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Pat" wrote in message
...
I'm trying to round a negative number with the functions floor and ceiling
but I don't get the expected value.
In italian version for floor() and ceiling():
ARROTONDA.DIFETTO(-4,2;-0,5) gets -4
ARROTONDA.ECCESSO(-4,2;-0,5) gets -4,5
instead of -4,5 and -4.
Can someone help me?
Thanks in advance
Patrizia







[email protected]

Rounding formulas for negative numbers
 
Bob Phillips wrote:
To quote help
FLOOR
Regardless of the sign of number, a value is rounded down when adjusted away
from zero. If number is an exact multiple of significance, no rounding
occurs


Obvious typo in the Excel Help page: is rounded down when adjusted
__toward__ zero.



All times are GMT +1. The time now is 05:54 AM.

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