Consulting

Results 1 to 8 of 8

Thread: Struggling to apportion value 'dynamically' - Worksheet attached

  1. #1

    Struggling to apportion value 'dynamically' - Worksheet attached

    Hi,
    I'm attempting to solve a little problem that I have.
    At the moment this is more or less a manual task using a calculator. But I'm trying to take it a step further and get this to dynamically work.

    So no matter how many rows I 'create' at 'item level' .. it will apportion the total appropriately.

    Here is a screenshot of my dummy sheet.

    Apportion Values.jpg

    I feel like I'm just overcomplicating my formula, but by doing so I'm pulling my hair out trying to achieve the correct answer

    Please help.

    Thanks

    Book2.xlsx

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Cell K3 Formula
    =AVERAGE(I3:I7)
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    Hi SamT,
    Thanks for your input. Average is probably a smarter solution to obtain the same answer that I currently have, and I guess that I would have to adapt it to work dynamically.
    However, it's not the correct answer. The correct answer is mentioned in column I.

    My data set looks very similar to the setup that I have shown, but instead of just have 4 Main References... I might have 10 - 20 Main References, and between 1 to 30 splits for each (which is what I'm trying to display on the workbook).
    So this is why I'm trying to get a dynamic formula to work with this problem.

    I've come up with

    =IFERROR(SUM(INDEX(C:C,MATCH(G3,A:A,0))/SUMPRODUCT(--(G:G=INDEX(A:A,MATCH(G3,A:A,0))))),"")
    Which gives me the same result as your:

    =AVERAGE(I3:I7)
    However, it's not what I'm looking for.
    I'm looking for something similar to what I currently have, but I feel like I'm missing a piece of the calculation to actually make it work correctly.

    Thank You

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,875
    In K3, something along the lines of:
    =VLOOKUP(G3,$A$3:$E$15,5,FALSE)*H3
    ?
    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.

  5. #5
    p45cal... Yes!! EXACTLY that. I knew my formula was over complicating it!!

    Now, one small (hopefully small) amendment...
    I built the example with what I hoped was a clear enough example to show you what was happening.
    In the 'live' spreadsheet, I don't have the "Apportioned Weight" column. But I do have everything else - more or less how it's laid out.

    Now this is an issue when I try to use your formula, because it's obviously looking for that value. So I need to adapt the formula in such a way that the formula is doing it... and not the sheet (or helper column).
    If the worst comes to it, then I'll just use a helper column, not a problem. But just for aesthetics, it would look nicer without

    If you know what I mean.

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Doesn't Excel => 2007 have an AVERAGEIF Function?

    Fill Down...
    K3 = If(G3 = "", "", AverageIF(I, G3))
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  7. #7
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,875
    =VLOOKUP(G3,$A$3:$C$15,3,FALSE)/VLOOKUP(G3,$A$3:$C$15,2,FALSE)*H3
    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.

  8. #8
    Thanks SamT, but I couldn't manage to get average or averageif to the correct result
    Thanks p45cal, your formula works perfectly.

    Thank you very much both for your time once again!!

Posting Permissions

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