WorksheetFunction.Floor method (Excel)
Rounds number down, toward zero, to the nearest multiple of significance.
Important
This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. This function is still available for compatibility with earlier versions of Excel. However, if backward compatibility is not required, you should consider using the new functions from now on, because they more accurately describe their functionality.
For more information about the new function, see the Floor_Precise method.
Syntax
expression.Floor (Arg1, Arg2)
expression A variable that represents a WorksheetFunction object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Arg1 | Required | Double | Number - the numeric value that you want to round. |
Arg2 | Required | Double | Significance - the multiple to which you want to round. |
Return value
Double
Remarks
As long as the number and specified significance have the same sign, Floor rounds towards zero to the nearest multiple of significance.
If either argument is nonnumeric, Floor returns the #VALUE! error value.
Excel allows positive and negative multiples of significance with negative numbers. In those cases, if the significance is positive, Floor rounds away from zero. Otherwise, if significance is negative, Floor rounds towards zero.
For positive numbers with negative multiples of significance, Excel returns the #NUM! error value.
If number is an exact multiple of significance, no rounding occurs.
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.