Consulting

Results 1 to 4 of 4

Thread: Iterative comparison in Excel using Macro

  1. #1

    Iterative comparison in Excel using Macro

    My excel looks like this. I'm interested in getting the last value (X) in the column named MTM. This value should be equal to the sum of the last column (TV).
    There are 3 below formulae
    CLV=MTM*LTV
    CG=20%(Total CLV)
    TV=min(CLV,CG)
    I could get this by trial and error but looking for a standard formulae such that the sum of TV is equal to MTM Value (X). The solver solves this in one or two iterations but I am looking for a VB code to use in macro that will solve this.

    MTM LTV CLV CG TV
    10000 1 10000 37435 10000
    11000 0.8 8800 37435 8800
    36000 0.8 28800 37435 28800
    52000 0.8 51600 37435 37435
    x 0.8 37435


  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Is this correct:?
    Capture3.JPG
    If so a couple of formulae will suffice.
    If not, what should the answer be?
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    52000 x .8 is not equal to 51600!
    So is this right?:
    Capture3.JPG
    If so formula in C6:
    =SUM(D2:D6)-SUM(C2:C5)

    Formula in A6:
    =C6/B6
    Last edited by p45cal; 07-06-2017 at 09:32 AM.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  4. #4
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location
    Hi ganesh6192, have you forgotten something important???? Like letting us know you have posted this thread elsewhere perhaps?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

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