Results 1 to 8 of 8

Thread: easy question

  1. #1

    Thread Starter
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295

    easy question

    if I have two numbers, a previous number and a current number. What formula would I use to find out the percentage difference between the two numbers.

    I did try and use (previous - current) * 100 / previous but it doesn't always work.

    any ideas.
    this should be easy.
    Craig Johnstone, MCP,CNA

    VB 6,SQL,Lotus Notes,Crystal Reports 7,8

    http://www.cajsoft.co.uk/downloads.htm

  2. #2
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    the percentage difference between what numbers?

    if the numbers are from 1 to 100 or something then yea, but you cant really take a percentage differnce of 2 numbers unless theres a specific range
    NXSupport - Your one-stop source for computer help

  3. #3

    Thread Starter
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295
    example.

    previous number is 500, current number is 550.
    What is the percentage change between these 2 numbers.
    Craig Johnstone, MCP,CNA

    VB 6,SQL,Lotus Notes,Crystal Reports 7,8

    http://www.cajsoft.co.uk/downloads.htm

  4. #4
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    CN = (CN/PN)*PN

    PN = (PN/CN) * CN

    So CN = 100*(CN/PN)% of PN
    and
    PN = 100*(PN/CN)% of CN


    Now, with CN = (CN/PN)*PN, I would say that

    PN changed by 100*((CN/PN) - 1)% to become CN.

    Which can be seen by

    PN + change = CN
    if we say that change = ((CN/PN)-1)*PN then

    PN + ((CN/PN)-1)*PN is indeed = CN

    So, PN to CN does indeed change by 100*((CN/PN)-1)% of PN.

    -Lou

  5. #5

    Thread Starter
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295
    In english please?
    Last edited by cajsoft; Oct 8th, 2003 at 05:52 PM.
    Craig Johnstone, MCP,CNA

    VB 6,SQL,Lotus Notes,Crystal Reports 7,8

    http://www.cajsoft.co.uk/downloads.htm

  6. #6
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    I didn't check his logic, but I'm sure it's accurate.

    100*((CN/PN)-1)% of PN = 100*((Current Number/Previous Number)-1) = The percent the Current Number differs from the Previous Number
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  7. #7
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    WGTN, New Zealand
    Posts
    338
    Maybe he wants PN as a percentage of CN?

    Wouldn't that be a simple (CN / PN) * 100?
    If PN = 500, and CN = 550, then CN is 110% of PN.

  8. #8
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Basically, thats exactly what Lou (NotLKH)'s code does, except it subtacts 1 (100%), making it x percent more than the first number instead of x percent of the first number, although you're exactly right about what you're saying.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width