Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
I have a ratio based on two variables: e' and d. If this ratio is larger than a condition, I want to assign d' to d and then recalculate the ratio. I want to keep the same variables; I just want the value of d' assigned to d and the ratio above recalculated. Is this possible? I have attached the sheet.
Solved! Go to Solution.
Simply assign the if-statement the variable d. You don't need the local(!) assignment d <-- d'.
Assignments inside a program always are local assignments and do not affect worksheet variables.
Only way to change a worksheet variable via a program is to assign it the output of a program.
Another way to achieve the same effect is
A more elaborate way is
Simply assign the if-statement the variable d. You don't need the local(!) assignment d <-- d'.
Assignments inside a program always are local assignments and do not affect worksheet variables.
Only way to change a worksheet variable via a program is to assign it the output of a program.
Another way to achieve the same effect is
A more elaborate way is
Thank you for the help, much appreciated! I actually ended up doing it a different way, but this works too.
Here are some addition simplifications you can use:
There is an Excel style "if()" function when you need a bit of brevity. Also, if you have a lot of basic Y/N or Pass/Fail tests, you can make simple global functions and place them at the end. It may be helpful because you do not want to have to keep writing the same code over and over and reduces errors and used real-estate.
Also, this is a preference of mine so ignore it if you prefer otherwise, I like to show D/C's because not only does it tell you if the check passes, but also how much reserve is left. So I have a simple global function with gives more focus to the result than the if statements. I modified your values a bit in the following example to demonstrate, But these numbers show that the axial is very efficient and moment resistance only needs a bit of tweaking.. The big bold "✖" is a dead giveaway when something is not working 😉
This is my function in case you are curious:
It's even shorter if you can do without the explicit “yes” and “no” 😉
Yup, that is even shorter.
In engineering, we like to put some sort of explicit confirmation, like a text. You want the reviewer to recognize the common wording that their office employs. My additional suggestion is that the coding for the 'verbose' result function does not get any more exciting as you review someone's calculation sheet. And you do not want to bore the reviewer... at least not to death! That is why a mundane function like that is better suited as a global function and defined at the end.
For future Prime versions, a real True/False number format, like in Excel, could also work in this situation. I would imagine that custom number formats would be a much, much future feature for Prime.