# 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
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

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
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Algorithms

From novice to tech pro — start learning today.