Number Range Formula

Posted on 2012-08-30
Last Modified: 2012-08-30
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?
Question by:turtleman2009
    LVL 26

    Expert Comment

    (A - 20000)/(80000) = (B -300)/(1700)
    LVL 26

    Expert Comment

    (A - 20000)/(80000) = (B -300)/(1700)
    LVL 26

    Accepted Solution

    What yup are calculating are the equivalent fractions of each range.

    35000 is 15/80 = 3/16

    B = 300 + (3/16)*1700
    LVL 26

    Expert Comment

    B = 618.75
    LVL 5

    Expert Comment

    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!
    LVL 27

    Expert Comment

    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
    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

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Complex Numbers are funny things.  Many people have a basic understanding of them, some a more advanced.  The confusion usually arises when that pesky i (or j for Electrical Engineers) appears and understanding the meaning of a square root of a nega…
    How to Win a Jar of Candy Corn: A Scientific Approach! I love mathematics. If you love mathematics also, you may enjoy this tip on how to use math to win your own jar of candy corn and to impress your friends. As I said, I love math, but I gu…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now