+ Reply to Thread
Results 1 to 5 of 5

Solve for integer combinations that equal a given ratio

  1. #1
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2019 for Mac
    Posts
    26

    Solve for integer combinations that equal a given ratio

    Hi

    I've been fiddling with columns and excel goal seek but I can't figure this out. I'm trying to find a list of number combinations that meet these requirements:

    1. x/y = 16/13
    2. x and y are integers
    3. x*y < 4 million

    So 512/416 and 1920/1560 are examples but a list of these is what I want. Is this possible?

    P.S. Oh and x and y must be positive.
    Last edited by rinkjames; 11-17-2012 at 08:26 AM.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Solve for integer combinations that equal a given ratio

    In A1 enter 16
    In B1 enter 13
    In C1 enter:
    =IF(A1*B1>=4000000,"STOP HERE","") and copy down

    In A2 enter:
    =A1*ROW() and copy down

    In B2 enter:
    =B1*ROW() and copy down

    In A1 thru C6 we see:

    16 13
    32 26
    96 78
    384 312
    1920 1560
    11520 9360 STOP HERE
    Gary's Student

  3. #3
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2019 for Mac
    Posts
    26

    Re: Solve for integer combinations that equal a given ratio

    Thanks a million

    OH wait a minute. I clicked "SOLVED" too soon. The above solution works but it doesn't give all integer combinations. Where's 512/416 for instance?
    Last edited by rinkjames; 11-17-2012 at 08:50 AM.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Solve for integer combinations that equal a given ratio

    maybe like this
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2019 for Mac
    Posts
    26

    Re: Solve for integer combinations that equal a given ratio

    Yeah this looks more like what I'm looking for. Thanks very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1