Recalculate part quantity based on part level to remove parts used in zero quantity assebly

AndrewTucker

New Member
Joined
Apr 21, 2017
Messages
1
Need to recalculate total part quantity based on :

  • if part quantity is zero, then result qty will be zero (this is simple just an if statement)
  • if part report up to an zero qty part e.g. if part level is "8" and it's preceding part "7" is zero qty; then part with level "8" is also zero in quantity.
  • resetting the part qty if the new part level is less than the zero Qty level

Part Level
Part Type
Qty
Result
1
Part 1
1
1
2
Part 2
1
1
3
Part 3
1
1
4
Part 4
1
1
3
Part 5
1
1
4
Part 6
1
1
4
Part 7
1
1
5
Part 8
1
1
6
Part 9
1
1
7
Part 10
0
0
These report to zero qty part; thus actual shipped qty is zero
8
Part 11
0
0
9
Part 12
1
0
10
Part 13
1
0
11
Part 14
1
0
12
Part 15
1
0
10
Part 16
2
0
These should be zero also
12
Part 17
3
0
12
Part 21
7
0
12
Part 22
8
0
3
Part 16
1
1
Part level resets here
6
Part 19
1
1
6
Part 20
1
1
2
Part 21
1
1
4
Part 22
1
1
5
Part 23
0
0
6
Part 24
1
0
Reports to zero qty
5
Part 25
0
0
6
Part 26
1
0
Reports to zero qty
5
Part 27
0
0
6
Part 28
1
0
Reports to zero qty
5
Part 29
0
0
6
Part 30
1
0
Reports to zero qty
5
Part 31
0
0
5
Part 32
0
0
6
Part 33
1
0
Reports to zero qty
5
Part 34
0
0
6
Part 35
1
0
Reports to zero qty
5
Part 36
0
0
6
Part 37
1
0
Reports to zero qty
4
Part 38
1
1
Part level resets here

<tbody>
</tbody>

I am using formula in result column (column D): =IF(C2=0,0,IF(AND(A2>A1,D1=0),D1,C2)
But this formula resets the result value if the part level is less than previous row but is greater than the "Zero quantity" part level. e.g. red highlighted line in above table.

Pls help. Thanks a lot in advance.

 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,215,952
Messages
6,127,913
Members
449,411
Latest member
AppellatePerson

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