Number Range Formula

I am creating an online tool and I understand the concept of what I need but not the exact formula to get me to where I want to be. I have two ranges of numbers the ranges will change but for this example we will use:

low a: 20,000
high a: 100,000


low b: 300
high b: 2000


So I will be given a number that fits inside of the range for "group a" and I need to find its equivalent for "group b" so if I was given  the number 35,000 for group a what is the formula to find its counterpart for group b?
turtleman2009Asked:
Who is Participating?
 
d-glitchCommented:
What yup are calculating are the equivalent fractions of each range.

35000 is 15/80 = 3/16

B = 300 + (3/16)*1700
0
 
d-glitchCommented:
(A - 20000)/(80000) = (B -300)/(1700)
0
 
d-glitchCommented:
(A - 20000)/(80000) = (B -300)/(1700)
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
d-glitchCommented:
B = 618.75
0
 
sfmnyCommented:
Hello there,

What's important to calculate here is the range of points in A and B.

The range of points in A is 80,000 - RangeA. For B it is 1700 RangeB

Let's call 'GivenA' the value to be converted into the new value in B called DeriveB.

GivenA - LowA gives you the value you can scale into B. B starts at an offset LowB. So:

(GivenA - LowA)/ RangeA = (DeriveB - LowB)/ RangeB

= (DeriveB - LowB) = ((GivenA - LowA)/ RangeA) * RangeB
= DeriveB = LowB + ((GivenA - LowA)/ RangeA) * RangeB)

Be careful with those brackets!
0
 
aburrCommented:
D-glitch has given you the answer. More generally let
the smallest a be = as
the largest a be = al
the smallest b be = bs
the largest b be = bl
-
let
the number in the a range be = a
the number for which you are looking in the b range be =  b
then the equation for b will be
b = (a – as) (bl – bs)/(al – as) + bs

which give the answer to you specific problem 618.75 as d-glitch said
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.