如何计算两个值的范围之间的百分比第三个值是 [英] How to calculate percentage between the range of two values a third value is

查看:64
本文介绍了如何计算两个值的范围之间的百分比第三个值是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

示例:

我试图找出用于计算两个值之间的百分比(第三个值是)的计算.

I'm trying to figure out the calculation for finding the percentage between two values that a third value is.

示例:范围为46到195.值46为0%,值195为范围的100%.值65在这个范围的百分之几?

Example: The range is 46 to 195. The value 46 would 0%, and the value 195 would be 100% of the range. What percentage of this range is the value 65?

rangeMin = 46

rangeMin=46

rangeMax = 195

rangeMax=195

inputValue = 65

inputValue=65

inputPercentage =?

inputPercentage = ?

推荐答案

好吧,我会使用公式

((input - min) * 100) / (max - min)

以您的示例为例

((65 - 46) * 100) / (195 - 46) = 12.75

或者更长一点

range = max - min
correctedStartValue = input - min
percentage = (correctedStartValue * 100) / range 


如果您已经有了百分比,并且正在寻找给定范围内的输入值",则可以使用评论:

value = (percentage * (max - min) / 100) + min

这篇关于如何计算两个值的范围之间的百分比第三个值是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆