Calculating percentage of 2 values


#1

I’ve not been able to find this calculation on the forum.
Can someone clever please give me the Expression calculation of… I have 2 values, min 1.5 max 2.9, so if device changes to say 2.1, I’d like to know what the percentage is within those 2 values. I’m sure this can be done with the requisite grey matter.


#2

I’m not sure if this is what you are asking but given minValue, maxValue, deviceValue, you would simply use:

percent=100*((deviceValue-minValue) / (maxValue-minValue))

Hope this helps.


#3

For a consistent min & max, here is a working expression:

(Device - 1.5) * 71.42857143

For example
(1.6 - 1.5) = 0.1 * 71.42857143 = 7.14%
(2.1 - 1.5) = 0.6 * 71.42857143 = 42.86%
(2.7 - 1.5) = 1.2 * 71.42857143 = 85.71%