+ Reply to Thread
Results 1 to 16 of 16

Need a Weight% to Reach Goal Formula

  1. #1
    Registered User
    Join Date
    05-16-2017
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    51

    Lightbulb Need a Weight% to Reach Goal Formula

    Hello All,

    Please find attach my problem.

    I need to fill column B with a weight percentage, but my "Volume Item" and "Bonus Per Item" columns must stay the same to achieve the weighted average goal of $38.81. My "Weight %" must equal to 100% and "Total Bonus" will equal "Total Bonus Goal" of $1,048,929.84 if "Weight %" are correct. I know there will be variable answers, but any answer will be fine.

    Pleaseee any help with this will be truly appreciated.

    Thank you,
    Attached Files Attached Files
    Last edited by lsantana; 03-24-2020 at 03:52 PM.

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Need a Weight% to Reach Goal Formula

    C17=sumproduct(iferror(c6:c16/d6:d16,))
    =iferror(c6/d6/$c$17,)
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-16-2017
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    51

    Re: Need a Weight% to Reach Goal Formula

    Quote Originally Posted by tim201110 View Post
    C17=sumproduct(iferror(c6:c16/d6:d16,))
    =iferror(c6/d6/$c$17,)
    Hello Tim,

    Sorry I forgot to write the "Weighted Average Check" must equal the "Weighted Average Goal" in yellow.

    Thank you,

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,403

    Re: Need a Weight% to Reach Goal Formula

    As with the other problem, I would start this as an algebra problem before making it a programming problem. In the previous problem we had 1 equation, so we could assign any random value to all but one of the weights, and then solve for the final weight. This case is the same, but we have a system of 2 equations, so we assign random values to 9 of the 11 weights and solve for the other 2.

    eq'n 1 weighted average: 38.81=A=sum(wi*xi) <-- Should already know how to solve this for w1 from earlier today.
    eq'n 2 weights: 1=Wtot=sum(wi)

    Shall I give you a chance to try the system of equations yourself? (A tutorial for simple systems of equations if you need an algebra refresher: https://www.purplemath.com/modules/systlin1.htm )
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    05-16-2017
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    51

    Re: Need a Weight% to Reach Goal Formula

    Quote Originally Posted by MrShorty View Post
    As with the other problem, I would start this as an algebra problem before making it a programming problem. In the previous problem we had 1 equation, so we could assign any random value to all but one of the weights, and then solve for the final weight. This case is the same, but we have a system of 2 equations, so we assign random values to 9 of the 11 weights and solve for the other 2.

    eq'n 1 weighted average: 38.81=A=sum(wi*xi) <-- Should already know how to solve this for w1 from earlier today.
    eq'n 2 weights: 1=Wtot=sum(wi)

    Shall I give you a chance to try the system of equations yourself? (A tutorial for simple systems of equations if you need an algebra refresher: https://www.purplemath.com/modules/systlin1.htm )
    Hello MrShorty,

    Yes I could do it as you suggested, but I need an excel working formula as Tim201110 closely did to automate this process. Because I am creating a macro that's going to copy information into column C and D then the macro would just copy column B results into another sheet. So I'm trying to check if there's a working formula that would fill in column B automatic.

    Thank you,

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,403

    Re: Need a Weight% to Reach Goal Formula

    I find that, before I can come up with a spreadsheet formula, I have to solve the algebra problem. In this case, I might solve the system of equations like this:

    From earlier w1=(A-sum(for i=2 to n)(wi*xi))/x1
    solve eq'n 2 for w1 w1=1-sum(for i=2 to n)(wi)
    set the two expression for w1 equal to each other 1-(w2+w3+...+wn)=(A-(w2x2+w3x3+...+wnxn))/x1
    Solve this for w2
    first multiply by x1: x1-x1(w2+w3+...+wn)=A-(w2x2+w3x3+...+wnxn)
    need to isolate the w2 terms w2x2-x1w2=x1(w3+...+wn)+A-(w3x3+...+wnxn)-x1
    divide by x2-x1 w2=(x1*(w3+...+wn))+A-(w3x3+...+wnxn)-x1)/(x2-x1)

    Now I can adapt that formula to spreadsheet syntax and enter that formula into B7. Then choose either eq'n 1 or eq'n 2 (eqn'2 is easier) and solve for w1. Enter that formula into B6

    B7 =(D2-sumproduct(B8:B16,D8:D16)-D6+D6*sum(B8:B16))/(D7-D6)
    B6=1-SUM(B7:B16)

    From there, it is a matter of entering reasonable and/or random values into B8:B16.

  7. #7
    Registered User
    Join Date
    05-16-2017
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    51

    Re: Need a Weight% to Reach Goal Formula

    Quote Originally Posted by MrShorty View Post
    I find that, before I can come up with a spreadsheet formula, I have to solve the algebra problem. In this case, I might solve the system of equations like this:

    From earlier w1=(A-sum(for i=2 to n)(wi*xi))/x1
    solve eq'n 2 for w1 w1=1-sum(for i=2 to n)(wi)
    set the two expression for w1 equal to each other 1-(w2+w3+...+wn)=(A-(w2x2+w3x3+...+wnxn))/x1
    Solve this for w2
    first multiply by x1: x1-x1(w2+w3+...+wn)=A-(w2x2+w3x3+...+wnxn)
    need to isolate the w2 terms w2x2-x1w2=x1(w3+...+wn)+A-(w3x3+...+wnxn)-x1
    divide by x2-x1 w2=(x1*(w3+...+wn))+A-(w3x3+...+wnxn)-x1)/(x2-x1)

    Now I can adapt that formula to spreadsheet syntax and enter that formula into B7. Then choose either eq'n 1 or eq'n 2 (eqn'2 is easier) and solve for w1. Enter that formula into B6

    B7 =(D2-sumproduct(B8:B16,D8:D16)-D6+D6*sum(B8:B16))/(D7-D6)
    B6=1-SUM(B7:B16)

    From there, it is a matter of entering reasonable and/or random values into B8:B16.
    Hello MrShorty,

    I've plugged in the formulas and it's working, just not with realistic numbers. See the attachment B6 shows -118.20% and B7 124.20%. I would need the "Weight %" to be a number from 0% to 100%. There has to be a way to utilize your formula to give a realistic number. Also this is a similar process how I'm doing it now manually just playing around with numbers until I could get the "Weighted Average Goal" of $38.81. I would need B8:B16 to be automated too without having to play around with the numbers. Is killing my brain right now because I feel like the solution is so close.

    Thank you,
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,403

    Re: Need a Weight% to Reach Goal Formula

    Have you understood what we have done so far? Because, from here, everything is just different applications and variations on this "solve a system of equations" approach that we are currently using. If you are not understanding how this works so far, then you will probably have trouble understanding what happens next.

    So the main question at this point is how to choose the random numbers. I notice that the target (38.81 in your example) is between the largest value (41.05) and the second largest value(37.65). This tells me that any valid solution where all of the weights are between 0 and 1 will need to include some non-zero number in B16, and may heavily favor this value. I reformulate my solution so that, instead of solving for B6, I solve for B16 (B6 now includes a random number, and B16 is =1-sum(B6:B15)).

    At this point, I ask myself what happens if I assume every wi is 0 except for two. So I look at what happens if I assume all but two wis are 0, and I end up with wi=(A-xmax)/(xi-xmax). Enter that formula into column J [J6=($D$2-$D$16)/(D6-$D$16)] and copy down into J7:J15. This column now represents the largest value that B6:B15 can have (assuming everything else is 0). No I can use these values to inform how I choose the random numbers to put into B6:B15.

    Does that help?

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,616

    Re: Need a Weight% to Reach Goal Formula

    Administrative Note:

    Please don't quote entire posts unnecessarily. They clutter threads and make them hard to read.
    Use the "Quick reply" instead
    Thanks

  10. #10
    Registered User
    Join Date
    05-16-2017
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    51

    Re: Need a Weight% to Reach Goal Formula

    Hello MrShorty,

    I thought I was good in math until I read your reply. I am totally lost now on how it will work. Can you please provide an example so I would see how it works? This way I could study it and learn how it works.

    Thank you,




    Hello Pepe Le Mokko,

    Sorry about that won't happen again.

    Thank you,

  11. #11
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,403

    Re: Need a Weight% to Reach Goal Formula

    I can't upload a file, but here are the edits I would make in your file:

    In J6 enter the formula I recently mentioned =($D$2-$D$16)/(D6-$D$16). copy/paste/fill down to J15
    In B6 enter =RAND()/10 (since there are about 10 values). Copy/paste/fill down to B15
    In B15 enter =1-SUM(B6:B15)

    Now examine the results and see what you think. Try different values in place of the 10, if you like. From there, we could also explore other ways to generate these random numbers.

  12. #12
    Registered User
    Join Date
    05-16-2017
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    51

    Re: Need a Weight% to Reach Goal Formula

    Hello MrShorty,

    See attached my spreadsheet Weighted Average still not matching goal Weighted Average Goal.

    Thank you,
    Attached Files Attached Files

  13. #13
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,403

    Re: Need a Weight% to Reach Goal Formula

    Forgot the other formula in one of the other wi cells. Which weight do you want tosolve for using =($D$2-SUMPRODUCT(other weights, other bonus)-$D$16+$D$16*SUM(other weights))/(this bonus-$D$16)?

  14. #14
    Registered User
    Join Date
    05-16-2017
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    51

    Re: Need a Weight% to Reach Goal Formula

    Hello MrShorty,

    I added the other formula now to B15, but as before it give a unrealistic number of a negative.

    Thank you,
    Attached Files Attached Files

  15. #15
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,403

    Re: Need a Weight% to Reach Goal Formula

    That just means tweaking the random numbers in B6:B14.

    You could try dividing by a larger number (maybe 12 or 20). =RAND()/12 or =RAND()/20. If you want to get serious about trying different values, enter 10 into A2 (or other cell), and use =RAND()/$A$2. Now you can try different divisors by entering whatever you want to try into A2.

    Or try incorporating the values in column J to inform these random numbers =RAND()*J6/10 (entered in B6 and copied/filled into B6:B14).
    Or any other suitable algorithm for choosing the values in B6:B14.

  16. #16
    Registered User
    Join Date
    05-16-2017
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    51

    Re: Need a Weight% to Reach Goal Formula

    MrShorty,

    I was able to use your formula combined with another strategy to get what I need sometime. I would take sometime getting the answers over how I was originally doing this manually, so it's a win for me. thank you again for all your help.

    thank you,

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How many more x to reach goal y%
    By alral1988 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-29-2017, 03:51 PM
  2. Replies: 7
    Last Post: 11-18-2016, 05:41 PM
  3. Calculating value needed to reach a certain % goal
    By Mrjpjones in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-14-2016, 03:38 PM
  4. Help Please - Need Formula To Figure How Many 100% Files to Reach 95% Goal
    By mrazexcel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-03-2016, 10:10 PM
  5. # Remaining to Reach Goal
    By CanadianFrodo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-23-2013, 02:45 PM
  6. If statements to reach a goal
    By curlly311 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-11-2008, 02:42 PM
  7. Excel Formula: Calculating averages to reach a goal?
    By PSUBrian in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-27-2007, 10:46 PM

Tags for this Thread

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