Index+Match/Index+Small

Mrbellav

New Member
Joined
Aug 29, 2018
Messages
2
So I have a workbook with two sheets

Sheet 1 (Demand)

Has a table of all of the items on the sales for a specific date and the quantities.
Column A= Item #
Column B=Sales order #
Column C=Date of sales order
Column D=Qty of Item on order

[TABLE="width: 500"]
<tbody>[TR]
[TD]Items[/TD]
[TD]Sales #[/TD]
[TD]Date[/TD]
[TD]Qty[/TD]
[/TR]
[TR]
[TD] Item 1[/TD]
[TD]SO#1[/TD]
[TD]9/1/18[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD] Item 2[/TD]
[TD]SO#1[/TD]
[TD]9/1/18[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD] Item 3[/TD]
[TD]SO#1[/TD]
[TD]9/1/18[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD] Item 2[/TD]
[TD]SO#2[/TD]
[TD]9/1/18[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD] Item 3[/TD]
[TD]SO#2[/TD]
[TD]9/1/18[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD] Item 1[/TD]
[TD]SO#3[/TD]
[TD]9/1/18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD] Item 4[/TD]
[TD]SO#4[/TD]
[TD]9/1/18[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD] Item 5[/TD]
[TD]SO#4[/TD]
[TD]9/1/18[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD] Item 1[/TD]
[TD]SO#4[/TD]
[TD]9/1/18[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]


Sheet two (Inventory)

This sheet has a list of items, the total demand of the item across all sales orders. And the total on hand inventory of each Item, then the difference in amount. (I have this set up to only show my negative amounts, I have a sheet with all and a sheet of just negatives)
-Function I'm looking for will only go on the sheet with negatives.

Column A= Item #
Column B=Total Demand
Column C=Inventory
Column D=Difference

[TABLE="width: 500"]
<tbody>[TR]
[TD]Items[/TD]
[TD]Total Demand[/TD]
[TD]Inventory (On Hand)[/TD]
[TD]Product Needed[/TD]
[/TR]
[TR]
[TD]Item 1[/TD]
[TD]11[/TD]
[TD]10[/TD]
[TD]-1[/TD]
[/TR]
[TR]
[TD]Item 2[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Item 3[/TD]
[TD]10[/TD]
[TD]5[/TD]
[TD]-5[/TD]
[/TR]
[TR]
[TD]Item 4[/TD]
[TD]10[/TD]
[TD]10[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Item 5[/TD]
[TD]6[/TD]
[TD]3[/TD]
[TD]-3[/TD]
[/TR]
</tbody>[/TABLE]

I already have a macro to move these Negative rows to a different sheet working correctly.


Sheet 3 Product Needed
Column a=Item#
Column B=Total Demand
Column C=Inventory
Column D=Product Needed

[TABLE="width: 500"]
<tbody>[TR]
[TD]Items[/TD]
[TD]Total Demand[/TD]
[TD]Inventory[/TD]
[TD]Product Short[/TD]
[/TR]
[TR]
[TD]Item 1[/TD]
[TD]11[/TD]
[TD]10[/TD]
[TD]-1[/TD]
[/TR]
[TR]
[TD]Item 3[/TD]
[TD]10[/TD]
[TD]5[/TD]
[TD]-5[/TD]
[/TR]
[TR]
[TD]Item 5[/TD]
[TD]6[/TD]
[TD]3[/TD]
[TD]-3[/TD]
[/TR]
</tbody>[/TABLE]


So what I'm looking for is a function to tell me all of the sales order number that will potentially be short.
Ex... Item 1, SO#1, SO#3, SO#4

What I have tried so far is a array:
Index(Sheet1'!B2:B10,match(0,if($g$1=Sheet'!A2:A10,countif($G$1:G1,Sheet1'!a2:a10).""),0))

Also tried an..
Index( x, small(if( row()-min(row(), rows())


Could not get this to work. I know I can use a pivot table, but would like to find it another way let me know if anyone has any ideas!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,224,820
Messages
6,181,155
Members
453,021
Latest member
Justyna P

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