That's only possible if the value of the fields is negative... If you want just add a condition that if the total is negative then return zero, or a blank string, instead of the actual number.
Thank you for your reply try67. I'm not a coder but I'd like to learn, that's why I'm here. The code above was graciously provided to me through this forum. I asked another person to help me interpret it and to make it work, so I've been really lucky this far in being able to complete the last form I created. My coworker is willing to help me out if I can get a little bit more information for my next issue. I need the form I'm working on now to display a score/percentage in the assigned text boxes, so it doesn't sound like retuning zero or a blank string will help me.
I just want to make sure I was clear in my question to confirm the best/correct answer.
The code above is used to display scores. The scores currently being displayed by using this code are displayed as percentages. All of the answers (ranging from 0 to 4) currently included in my form are positive answers, so the score (produced by this code) will always be 0 to 100%. The code considers that "0" as an answer will not be factored into the overall score/percentage.
I'm creating a new form that produces answers that range from -2 to 2. The answers produce negative scores/percentages if the answers are negative. That's why I would like the code to consider asigned values for each possible score on my new form so that the score/percentage displayed is never negative. It would solve my problem If the code could calculate the following numbers as described to produce the positive score/percentage:
- calculate -2 as a value of 1
- calculate -1 as a value of 2
- Keep 0 = 0
- Calculate 1 as a value of 3
- calculate 2 as a value of 4
It's a bit of a strange configuration, but it's certainly doable. Basically you need to add 3 to the value if it's smaller than 0 or 2 if it's greater than 0, and you'll get the results you've described.
That worked. Thanks again! We had the first part but for some reason didn't think to add to the numbers greater than 0. My new form is going to work wonderfully for those who need it! Until next time... have a wonderful day!