+ Reply to Thread
Results 1 to 6 of 6

Goal Seek for achieving two simultaneous goals

  1. #1
    Registered User
    Join Date
    07-27-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Goal Seek for achieving two simultaneous goals

    I have a format for bifurcating sales amount among different tax slabs (2.5%, 12.5%, 18% & 28%)

    Net values in column D represent the basic value, VAT amount values in column E are subsequent VAT values (Net X Rate)

    I have the following values that are known:
    Total Net Amount (Cell D1)
    Total Vat Amount (Cell E1)

    The Result expected:
    Sum of Current Net Values = Cell D2
    Sum of VAT AMount Values = Cell E2

    Condition: The amounts within D6 to D9 need to be adjusted in such a way that subsequent VAT Amount total is also equal to the total of VAT known (E2)

    I have used the macro for Goal seek but it allows to change only 1 set of values. There are multiple such calculations required on different occassions.

    Could you help me find a better way to do this?
    Attached Files Attached Files
    Last edited by hanif55; 06-02-2020 at 05:15 PM. Reason: Attaching

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,844

    Re: Goal Seek for achieving two simultaneous goals

    Is the problem solvable? Why is the VAT in E6 calculated differently from the VATs in E7:E9? Are you required to use Goal Seek, or will a different approach be allowed.

    I like to solve problems like this mathematically/algebraically before trying to program the solution. At first glance, it looks like a "system of equations" kind of problem where you have 2 equations in 4 unknowns (so there are likely many possible solutions if it can be solved). Solving as a system of equations should allow you to completely bypass a numeric "goal seek" algorithm and program in a direct solution.

    The first question might be to determine if a solution is possible. In this case, assuming that All Net values must be greater than or equal to 0 (not negative Nets), the values in D3 and E3 suggest that you need an average rate of about 41%, but the highest Rate in column C is 28%. Assuming all Nets must be greater than 0, then the example in the attached seems unsolvable.

    Once determined that the problem can be solved, I can choose any reasonable value for any two of the values in D6:D9 (the average Rate determined by dividing E3 by D3 should be useful for this), then solve for the other two values as a system of 2 equations in 2 unknowns.

    What do you think? Is that too much algebra to get simpler programming, or do you want to continue to pursue a "goal seek" type algorithm solution?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    07-27-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Goal Seek for achieving two simultaneous goals

    I am not bent on using Goal Seek to solve this, it's just that I believe GS will probably get me closest to the kind of solution I need. I require the problem to be solved, not concerned about the ways. So either programmatic or algebraic is fine, as long as I understand the underlying principle.

    VAT calculated in E6 was an error (I forgot to revert an experiment). All VAT values are the Net amount multiplied by their subsequent VAT rates.

    I understand that this problem is complex due to the number of unknowns. I have explored keeping VAT amounts as a percentage of the total VAT and then reverse-calculating the net amounts, but somehow couldn't achieve the end-goal (probably due to my lack of understanding of equations).

    We could, I suppose, force/assume values of any variables within these equations. I will have to allow that fluidity as long a the sum totals are correct and calculations within each tax slabs are accurate.

    I am unable to answer your question if the problem can be solved, maybe I am being ambitious in the problem statement and should have started off small. But I am looking for a solution that could split between 4-5 different tax slabs. You could also choose to assume one or more of Net values to also be 0. It just cannot be a negative value.

    Your suggestion about assuming values for 2 variables and then solving it further for x & y seems like a good way to start. Could you please elaborate it for better understanding?

    Really appreciate your time.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,844

    Re: Goal Seek for achieving two simultaneous goals

    Remembering the algebra to solving these begins with this series of algebra lessons: https://www.purplemath.com/modules/systlin1.htm Then ends here, https://www.excel-easy.com/examples/...equations.html where we take everything learned about solving systems of equations and reduce it to a few simple matrix operations that are preprogrammed into the Excel functions MMULT() and MINVERSE().

    Nettotal=SUM(NETs)=Net1+Net4+SUM(otherNETs)
    VATtotal=SUM(VATs)=SUMPRODUCT(NETs,RATEs)=Net1*Rate1+Net4*Rate4+SUMPRODUCT(otherNets,otherRates)
    Move all of the "known" terms to one side:
    NETtotal-SUM(otherNETs)=NET1+NET4
    VATtotal-SUMPRODUCT(otherNETs,otherRates)=NET1*Rate1+NET4*Rate4
    Put into the terms of Excel Easy's matrix solution A={1,1;Rate1,Rate4}, X={NET1;NET4}, B={NETtotal-SUM(otherNETs);VATtotal-SUMPRODUCT(otherNETs,otherRATEs)}

    Now I can build these matrices in the spreadsheet and solve the system of equations for whatever values I want to enter in NET3 (D7) and NET2(D6).

    For matrix A, Enter 1 in B13 and C13 and enter =C6 in B14 and =C9 in C14.
    For matrix B, enter =D3-SUM(D7:D8) into E13 and enter =E3-SUM(E7:E8) into E14
    The inverse of A is =MINVERSE(B13:C14) array entered into G13:H14
    The X matrix (and the solution to the problem) is =MMULT(G13:H14,E13:E14) array entered into J13:J14

    To check the solution, I can enter =J13 into D6 and =J14 into D9 and see that the solution works.

    The reason I asked about whether or not the given example was solvable is that the average Rate for NETtotal of 6100 and VATtotal of 2500 is 2500/6100=41%. The highest rate in C6:C9 is 28%. From this observation, I know that I cannot get an average Rate of 41% from rates of 2.5 to 28% unless at least one of NETs is less than 0. If you don't care that one or more NETs can be negative, then the algebra/programming don't care. If you need a programming step to test for averageRate between 2.5 and 28% in order to flag problems where the solution must include one negative number, then you can include that extra programming step. If having all NETs be greater than 0, it may also be valuable to calculate some limits on D7 and D8 so that you know what values are allowed in these cells so that D6 and D9 don't end up being negative.

  5. #5
    Registered User
    Join Date
    07-27-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Goal Seek for achieving two simultaneous goals

    Sorry Sir,
    Everything went over my head .
    Sir I am a commerce student Know nothing about Matrix, MINVERSE OR MMULT

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,844

    Re: Goal Seek for achieving two simultaneous goals

    For generations, one of the biggest challenges in math education has been to help students see how what they learn in math classes applies to other fields -- including commerce. I am not enough of a math educator to bridge that gap for you, but I might suggest that, if you can figure out how to apply what you have learned in math classes to your commerce coursework, you will find that your commerce coursework will be easier.

    I am attaching a spreadsheet with the solution I outlined in post #4. Perhaps it will help you understand what I proposed in post #4, or perhaps it will confuse you even more. Review the spreadsheet and review what I wrote in post #4 and see if it helps you understand how we are applying math to the commerce problem.
    Attached Files Attached Files

+ 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. Adjust quota goals based on revenue goal - seems complex
    By Yourname in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-26-2017, 11:38 AM
  2. [SOLVED] Seeking Goal without using Goal Seek
    By Doc Science in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-07-2015, 02:24 PM
  3. [SOLVED] Simultaneous Goal Seek
    By avarax in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-04-2013, 04:00 AM
  4. Replies: 3
    Last Post: 07-27-2012, 01:44 PM
  5. Goal Seek VBA with relative 'Goal' parameter
    By alirulez in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2012, 07:19 PM
  6. Goal Seek Formula But Not Using Goal Seek
    By cady923 in forum Excel General
    Replies: 1
    Last Post: 08-05-2011, 03:53 PM
  7. Goal Seek VBA Help
    By BFlick11 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-31-2010, 12:42 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