3 Replies Latest reply on Jul 27, 2016 7:50 PM by darrellm34702

# Figure the percentage range of a single number

For example is there anyway to have java calculate 60%-80% of 300 and display the answer in format similar to 180-240?  The number I need to get the ranges on are in one cell and I'd like the result displayed in a second.

• ###### 1. Re: Figure the percentage range of a single number

Just multiply the values of the two fields and it should work.

• ###### 2. Re: Figure the percentage range of a single number

So you have one field that has the value of "60%-80%" and the other a user entered value and you want a script to calculate the numeric range of the entered number base on the percentage range of the first field. Since the first field is a character string you need to parse that string into the number and symbols , you can then convert the whole numbers that are the percentages into two variables, the first being the lower percentage, in your example 0.60, and the upper percentage, 0.80 in your example.

Is the first field user entered?

If not you should be able to use the hard coded values from that field.

• ###### 3. Re: Figure the percentage range of a single number

What I am trying to do is an auto calculating form fillable sheet for a friends pen and paper rpg.  They would enter their hit points the 300 in the above example.  The character is stunned if they take damage that puts them between 60%-80% of their max hit points.  Figuring out and displaying what the 60%-80% of that 300 is where I am running into problems.