Challenging Formula / Script needed - Does it Fit?

JumboCactuar

Well-known Member
Joined
Nov 16, 2016
Messages
788
Office Version
  1. 365
Platform
  1. Windows
Hi,
i have the following data

[TABLE="width: 359"]
<tbody>[TR]
[TD]ITEM NO[/TD]
[TD]TYPE[/TD]
[TD]LOCATION[/TD]
[TD]QTY[/TD]
[TD]MAX QTY[/TD]
[/TR]
[TR]
[TD]11224[/TD]
[TD]PRIORITY[/TD]
[TD]AL4401[/TD]
[TD]4[/TD]
[TD]14[/TD]
[/TR]
[TR]
[TD]11224[/TD]
[TD]RESERVE[/TD]
[TD]GL1202[/TD]
[TD]12[/TD]
[TD]14[/TD]
[/TR]
[TR]
[TD]55322[/TD]
[TD]PRIORITY[/TD]
[TD]AL5503[/TD]
[TD]8[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]55322[/TD]
[TD]RESERVE[/TD]
[TD]GL1104[/TD]
[TD]10[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]55322[/TD]
[TD]RESERVE[/TD]
[TD]GL1105[/TD]
[TD]2[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]43112[/TD]
[TD]PRIORITY[/TD]
[TD]AL5512[/TD]
[TD]6[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]43112[/TD]
[TD]RESERVE[/TD]
[TD]GL4401[/TD]
[TD]55[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]67442[/TD]
[TD]PRIORITY[/TD]
[TD]AL5212[/TD]
[TD]14[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]67442[/TD]
[TD]RESERVE[/TD]
[TD]GL1201[/TD]
[TD]5[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]57743[/TD]
[TD]PRIORITY[/TD]
[TD]AL5603[/TD]
[TD]0[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]57743[/TD]
[TD]RESERVE[/TD]
[TD]HL1201[/TD]
[TD]4[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]80888[/TD]
[TD]PRIORITY[/TD]
[TD]BL0102[/TD]
[TD]5[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]80888[/TD]
[TD]RESERVE[/TD]
[TD]GL1203[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]80888[/TD]
[TD]RESERVE[/TD]
[TD]HL1204[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]80888[/TD]
[TD]RESERVE[/TD]
[TD]GL5503[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]

I need to do the following:

If Reserve QTY fits into Priority Location then output them like this:


[TABLE="width: 287"]
<tbody>[TR]
[TD]ITEM NO[/TD]
[TD]FROM[/TD]
[TD]TO[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]11224[/TD]
[TD]GL1202[/TD]
[TD]AL4401[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]55322[/TD]
[TD]GL1104[/TD]
[TD]AL5503[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]55322[/TD]
[TD]GL1105[/TD]
[TD]AL5503[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]43112[/TD]
[TD]GL4401[/TD]
[TD]AL5512[/TD]
[TD]55[/TD]
[/TR]
[TR]
[TD]57743[/TD]
[TD]HL1201[/TD]
[TD]AL5603[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]80888[/TD]
[TD]GL1203[/TD]
[TD]BL0102[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]80888[/TD]
[TD]HL1204[/TD]
[TD]BL0102[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]80888[/TD]
[TD]GL5503[/TD]
[TD]BL0102[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]


Not even sure how to go about doing this, i thought probably using pivots but its tricky

Appreciate any help
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,225,760
Messages
6,186,868
Members
453,380
Latest member
ShaeJ73

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