• Status: Solved
• Priority: Medium
• Security: Public
• Views: 381

# Need an Excel formula to determine share for each location and item.

I’m looking for any recommendations on an algorithm that could be used to assign volume from my “Qty Remaining” column to the appropriate cells in the “Actual Order” table.  If you review my attachment, you’ll get a clearer picture of what I’m looking to accomplish.

Nevertheless, here’s a basic run down of what I’m looking for:

1.  The quantities “Grand Total” columns in both the “Initial Request” and “Actual Order” table must end up matching.

2. The totals under each “Location” column can change, but the combined totals of all three locations will still need to match in
both tables.

3. When a location’s “Actual Order” volume is reduced from its “Initial Request”, I can use a simple formula like this IF(H\$6<=B\$6,(B3/B\$6)*H\$6) to make an adjustment.

4. However, when the volume is increased, I’m at a loss on how to spread the remaining quantity.  I must meet the location’s total without exceeding the item’s grand total.

Again, please refer to my attached file for a clear picture of what I’m looking for.  Any recommendations on a formula that would handle this would be greatly appreciated.  Thanks!

Question.xlsx
0
KP_SoCal
• 2
• 2
1 Solution

Commented:
The trouble you run into is what rules do you want to use for distributing the "extra" that was ordered but never requested? If you're alright with evenly splitting the extra, and dealing with some fractional fruit, try this. :)

I added a table at N1:P5, and put another block below the Actual Order section to show how much to actually SHIP.

Question2.xlsx
0

Commented:
I guess I shouldn't say split evenly.. It's split evenly inasmuch as it's split across all three items in the proportion of what is left to be spread without regard to the original request values.
0

Commented:
Well this seems confusing still, but I'm getting the hang of it. What's the purpose of "Remain Qty to Spread"? The location Sums are already at an acceptable value (SUM = 300) so what is this "spreading"?

And how would you want Qty Remaining to be consumed by the 3x3Cells of Actual Order - wouldn't that make those values wrong?

Could you post an example of what the ideal result would look like?
0

Author Commented:
Thank you!  I can tailor this into what I'm trying to accomplish. =)
0

Author Commented:
I just posted another question that is somewhat of a spinoff on this question if you would like to take a stab at it.  Your previous solution worked great for me.

http://www.experts-exchange.com/Programming/Algorithms/Q_26969348.html

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.