Table of Contents
In VBA, rounding down refers to the process of reducing a numerical value to its nearest lower integer. This can be achieved using the VBA RoundDown function, which takes two arguments – the value to be rounded and the number of decimal places to round to. For example, RoundDown(6.8, 0) would return 6 as the nearest lower integer to 6.8. This feature is commonly used in financial calculations, such as rounding down prices or quantities in invoices and receipts. It can also be useful in creating charts and graphs, where precise decimal values may not be necessary. Overall, the RoundDown function in VBA provides a simple and efficient method for rounding down values, ensuring accuracy and consistency in data analysis and manipulation.
Round Down Values in VBA (With Examples)
You can use the RoundDown method in VBA to round values down.
This function uses the following basic syntax:
Sub RoundDownValue()
Range("B1") = WorksheetFunction.RoundDown(Range("A1"), 0)
End SubThis particular example will round down the value in cell A1 to the nearest whole number and display the result in cell B1.
Note that the second argument in the RoundDown method specifies the number of digits to round where:
- -3 rounds down to the nearest thousand
- -2 rounds down to the nearest hundred
- -1 rounds down to the nearest ten
- 0 rounds down to the nearest whole number
- 1 rounds down to the nearest tenth (one decimal place)
- 2 rounds down to the nearest hundredth (two decimal places)
- 3 rounds down to the nearest thousandth (three decimal places)
And so on.
The following examples show how to use the RoundDown method in practice.
Example 1: Round Down to Nearest Whole Number in VBA
We can create the following macro to round down the value in cell A1 to the nearest whole number and display the result in cell B1:
Sub RoundDownValue()
Range("B1") = WorksheetFunction.RoundDown(Range("A1"), 0)
End SubWhen we run this macro, we receive the following output:

Notice that the value 1,432.78 in cell A1 has been rounded down to the nearest whole number of 1,432 in cell B1.
Example 2: Round Down to Nearest Hundred in VBA
We can create the following macro to round down the value in cell A1 to the nearest hundred and display the result in cell B1:
Sub RoundDownValue()
Range("B1") = WorksheetFunction.RoundDown(Range("A1"), -2)
End SubWhen we run this macro, we receive the following output:

Notice that the value 1,432.78 in cell A1 has been rounded down to the nearest hundred of 1,400 in cell B1.
Example 3: Round Down to Nearest Tenth in VBA
We can create the following macro to round down the value in cell A1 to the nearest tenth (i.e. one decimal place) and display the result in cell B1:
Sub RoundDownValue()
Range("B1") = WorksheetFunction.RoundDown(Range("A1"), 1)
End SubWhen we run this macro, we receive the following output:

Notice that the value 1,432.78 in cell A1 has been rounded down to the nearest tenth of 1,432.7 in cell B1.
Note: You can find the complete documentation for the VBA RoundDown method .
Cite this article
stats writer (2024). How can I round down values in VBA, and what are some examples of using this feature?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-round-down-values-in-vba-and-what-are-some-examples-of-using-this-feature/
stats writer. "How can I round down values in VBA, and what are some examples of using this feature?." PSYCHOLOGICAL SCALES, 24 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-round-down-values-in-vba-and-what-are-some-examples-of-using-this-feature/.
stats writer. "How can I round down values in VBA, and what are some examples of using this feature?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-round-down-values-in-vba-and-what-are-some-examples-of-using-this-feature/.
stats writer (2024) 'How can I round down values in VBA, and what are some examples of using this feature?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-round-down-values-in-vba-and-what-are-some-examples-of-using-this-feature/.
[1] stats writer, "How can I round down values in VBA, and what are some examples of using this feature?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can I round down values in VBA, and what are some examples of using this feature?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
