+ Reply to Thread
Results 1 to 7 of 7

nesting issue involving percentages

  1. #1
    Registered User
    Join Date
    06-10-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Angry nesting issue involving percentages

    I have tried an array of math to the following percentage issue to no avail. I have 4 cells. 1 is for positive credits B10 and one is for total pool A10. In this case the goal is 70%. I have a cell A51 which subtracts B10 from A10 to give the total negatives. B51 is the kicker. I need to use the information above to determine how many have to be added to both the credit and the pool to get 70%. First I decided to use IF statements ie; IF(B10/A10)>.69,""(IF((B10+1)/(A10+1)>.69,1,(IF((B10+2)/(A10+2)>.69,2,(IF....and so on...this seems like stone wheel days to me and there must be an easier way..It will only let me go to 7 due to nesting issues anyway. Anyone know the correct math? If I started with 5 credits and 12 in the total pool (41.7%) I know that I would have to add 12 to both the credit and total pool or 17/24 to get to 70%. I would like cell B51 to indicate 12 needed to meet goal...help
    Last edited by statictwist; 06-10-2010 at 12:41 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: nesting issue involving percentages

    Can I ask, given the 12, 5 & 70% rate why would the result be 9 ? Shouldn't it be 12 ?

    12 + 9 = 21
    5 + 9 = 14
    14/21 -> 67% (thereabouts) - ie this fails the 70% limit

    12 + 12 = 24
    5 + 12 = 17
    17/24 -> 71% (thereabouts) - ie this passes the 70% limit (11 does not)

    I am sure there are ways for calculating this with math but in terms of a brute force method:

    C51:
    =MIN(IF(((B10+ROW(1:100))/(A10+ROW(1:100)))>=0.7,ROW(1:100)))
    confirmed with CTRL + SHIFT + ENTER

    the use of 100 is relative of course - and might need adjusting based on values in row 10

  3. #3
    Registered User
    Join Date
    06-10-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: nesting issue involving percentages

    Quote Originally Posted by DonkeyOte View Post
    Can I ask, given the 12, 5 & 70% rate why would the result be 9 ? Shouldn't it be 12 ?

    12 + 9 = 21
    5 + 9 = 14
    14/21 -> 67% (thereabouts) - ie this fails the 70% limit

    12 + 12 = 24
    5 + 12 = 17
    17/24 -> 71% (thereabouts) - ie this passes the 70% limit (11 does not)

    I am sure there are ways for calculating this with math but in terms of a brute force method:

    C51:
    =MIN(IF(((B10+ROW(1:100))/(A10+ROW(1:100)))>=0.7,ROW(1:100)))
    confirmed with CTRL + SHIFT + ENTER

    the use of 100 is relative of course - and might need adjusting based on values in row 10
    You are correct...It is 12 not 9, I counted a column twice. I will give the brute force method a whirl

  4. #4
    Registered User
    Join Date
    06-10-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: nesting issue involving percentages

    No go, it returned a 0 instead of the 12 we discussed.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: nesting issue involving percentages

    note the text in red / bold font in my prior post.

  6. #6
    Registered User
    Join Date
    06-10-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: nesting issue involving percentages

    Thanks, I got it...It worked!

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: nesting issue involving percentages

    OK, being a doofus at this stuff I had to ask my Dad to give me the math:

    Quote Originally Posted by Dr D.O. PhD

    (x+B1)/(x+A1)=p
    where p is the percentage required

    then
    x+B1=px +p*A1

    or

    x(1-p)=p*A1-B1

    so

    x = (p*A1 - B1)/(1-p)
    so this simplifies things significantly such that your function becomes:

    =(0.7*A1-B1)/(1-0.7)

    To round this value up to nearest whole integer we can either use ROUNDUP or CEILING, using the latter:

    =CEILING((0.7*A1-B1)/(1-0.7),1)

    This approach is obviously far more efficient than the Array.

+ 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