Martijn Wingelaar Posted February 6, 2021 Share Posted February 6, 2021 Hello Users. I've got a worksheet formula translation problem. I got this code from my excel file. But that doesn't work with my worksheet. Does anyone has a solution? =ROUNDDOWN((E6-SUM($H$9:H9))/D10;0) I added my xls file as well for reference how the code should work. Greetings M Wingelaar. Worksheet code question.xls Quote Link to comment
JBenghiat Posted February 6, 2021 Share Posted February 6, 2021 Truncate should work instead of rounddown. Truncate drops the decimal component, which has the same effect. (I can’t recall if the function is TRUNC or TRUNCATE). I also don’t think VW can use the “$” qualifier Quote Link to comment
Martijn Wingelaar Posted February 6, 2021 Author Share Posted February 6, 2021 Let me try that thanks. Quote Link to comment
Pat Stanford Posted February 7, 2021 Share Posted February 7, 2021 Vectorworks worksheets do accept $A$1 format to provide an absolute cell reference rather than a relative cell reference. Rounddown is a worksheet function in VW2021. Truncate or Trunc are not. Quote Link to comment
MullinRJ Posted February 8, 2021 Share Posted February 8, 2021 @Martijn Wingelaar , The Rounddown() worksheet function exists from VW 2018 to the present. In your example code you are using a semi-colon between the first and second arguments, instead of a comma. This may be causing your error if you entered it into VW that way. Caveat: there appears to be a difference in the way Rounddown() works between Excel and VW. In VW, Rounddown(NUM, 0) rounds numbers to the more negative integer if there is a non-zero fractional part. In Excel Rounddown() rounds toward zero. The difference in Excel between Rounddown() and Round() is that Rounddown() allows you to specify the number of decimal digits to keep where Round() does not. If you want the Excel functionality of Rounddown(NUM, 0) you can simply use the Round(NUM) function in VW. It always truncates the number to the closest integer toward ZERO. However, if you want a true Rounddown() function in a version of VW older than VW 2018, then you can use a modification of this formula: =IF(NUM-INT(NUM)<0, INT(NUM)-1, INT(NUM)) # rounds numbers with fractions to the nearest integer that is more negative than the number. if you are wanting to specify decimal accuracy greater than "0" digits, the formula will become a bit more complicated. I'll leave it to minds more curious than mine to try their hand at it. HTH, Raymond PS - If you would kindly include your version of VW, and your platform / OS combination in your forum signature, it will help forum members answer your questions more accurately and often faster. Thank you. 1 Quote Link to comment
Martijn Wingelaar Posted February 9, 2021 Author Share Posted February 9, 2021 @ MullinRJ That works thanx for the help. Quote Link to comment
MullinRJ Posted February 10, 2021 Share Posted February 10, 2021 Martjin, You're welcome. Out of curiosity, what version of VW are you using? Raymond 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.