unearthed Posted April 26, 2022 Share Posted April 26, 2022 I've been playing with INT in a worksheet this morning and realised it always rounds down so: =(INT(9.1) =(INT(9.9) both round to 9 Which result in us having to do a bit of number wrangling to get the correct result. e.g. michaelk in 2011 As a non-programmer can someone tell me what VW is doing here? Quote Link to comment
Guest Wes Gardner Posted April 26, 2022 Share Posted April 26, 2022 @unearthed , I'm guessing here but since it's an integer function, perhaps it will always return the whole number so in essence, it'll round down? There's also a ROUNDUP function... Wes Quote Link to comment
rDesign Posted April 26, 2022 Share Posted April 26, 2022 Wes is correct, this is the same way that the INT function works in Excel (and Google Sheets, etc): It rounds a real number down to the nearest integer. If that's not what you want, you might want to use ROUNDUP as Wes suggested. Quote Link to comment
Pat Stanford Posted April 27, 2022 Share Posted April 27, 2022 In VW2022 you can use Round instead of Int to round to the nearest integer. Int is intended to work with Mod to get the integer and fractional parts of a number. I don't know if Round was available in VW2012. Quote Link to comment
unearthed Posted April 27, 2022 Author Share Posted April 27, 2022 Thank Pat, I'm on 2018 (have just updated sig), I'll try ROUND, INT leads to a string of characters to mitigate the round down default. Is their a Reference that states what's under the hood for all the functions? I don't really want to know but VW (especially) has taught me it's dangerous to assume. Quote Link to comment
Pat Stanford Posted April 27, 2022 Share Posted April 27, 2022 Search the VW Help for Worksheet Functions. It should have a page for your version. The only one I have right now is for 2022. 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.