How to sum cell values until it reaches a value then count the number of rows in a dynamic table

sciphinupe

New Member
Joined
May 28, 2014
Messages
7
Hello Everyone,

I am in a dilemma I hope some wise person can help solve. I have a dynamic table consisting of 150+ rows with 3 main categories I'm looking to extract information. I've tried to use all forms of nesting SUMIFS & COUNTIFS and arrays but I can't figure it out and haven't seen any video form Mr. Excel on this topic. I'm hoping someone can share a formula or information that will:

1. Sum the number of orders exclusively for each part but only UP TO THE AMOUNT OF STOCK ON HAND

2. Count the number of rows it took for the number of orders to be as close as or equal to the stock on hand

For example, in the chart below there are 13 rows of orders/customers for 2 separate part numbers. Part A has 15 orders however there are only 2 in stock, and part B has 470 orders for however we only have 39 in stock.

I would like a formula I can use (for all the part number in my table) to be able to look at the 6 rows of part A and add cells in increments until the order number doesn't surpass stock on hand (SOH) number; 2. Also, to do the same thing for the 7 rows for part B.

Customers
PNOrdersStock on hand
1
Part A12
2Part A32
3Part A52
4Part A22
5Part A22
6Part A22
7Part B10039
8Part B10039
9Part B3839
10Part B10039
11Part B10039
12Part B139
13Part B3139



When calculating correctly I would like the formula to show for Part A one customer's order can be filled (because there is 2 SOH) but for Part B two customer's orders can be filled (customer 12 has 1 order & customer 13 has 31 orders; therefore, these two smaller orders within Part B's SOH should be satisfied first before that of customer 9's order).

I understand it's a lot to digest so hopefully someone will have an idea how I can tackle this issue. In summary, I need to understand how many customers' order lines have or have not been satisfied given the amount of available stock for each particular part. None the videos I watch for information I could find so far addresses how to count the number of remaining rows of a particular part after excluding rows that has met a criteria.

Thanks all so much!!!

Greg
 
Afternoon Peter,

Yes, so far it seems as if your modification works. Thanks again! I will continue to "test-drive" the formula to validate it can solve all circumstances.

Warmest regards and Happy Holidays,

Greg
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,214,908
Messages
6,122,186
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top