Trying to understand index/match for specific scenario

HOGGL

New Member
Joined
Nov 2, 2017
Messages
7
Hi,

I seem to be able to use index/match for a specific scenario but struggling to apply it to others so looking for some help - maybe that's not even the best way of doing it.

I have two data sources a list of products and another data source with the products, order despatch dates and shortages.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Product[/TD]
[TD]First Shortage[/TD]
[TD]First Shortage Date[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]123[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]456[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]789[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

The source data I'm looking to draw from is similar to the below:

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Product[/TD]
[TD]Order Date[/TD]
[TD]Shortage[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]123[/TD]
[TD]02/05/2018[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]123[/TD]
[TD]15/06/2018[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]123[/TD]
[TD]17/07/2018[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]456[/TD]
[TD]01/01/2019[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]456[/TD]
[TD]02/01/2019[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]456[/TD]
[TD]02/02/2019[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]456[/TD]
[TD]03/03/2019[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]789[/TD]
[TD]01/12/2017[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]789[/TD]
[TD]01/01/2018[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]


















I'm looking for a formula that will return the first time we're going to be short on a product and the date that the first shortage will occur. Here are the results i'd expect below.

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Product[/TD]
[TD]First Shortage[/TD]
[TD]First Shortage Date[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]123[/TD]
[TD]5[/TD]
[TD]17/07/2018[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]456[/TD]
[TD]1[/TD]
[TD]01/01/2019[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]789[/TD]
[TD]5[/TD]
[TD]01/01/2018[/TD]
[/TR]
</tbody>[/TABLE]









How am i best to do it? Any ideas?

Thanks in advance.

L
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Try


Excel 2010
ABC
1ProductFirst ShortageFirst Shortage Date
212357/17/2018
345611/1/2019
478951/1/2018
Sheet5
Cell Formulas
RangeFormula
B2{=INDEX(Sheet6!$C$2:$C$10,SMALL(IF(A2=Sheet6!$A$2:$A$10,IF(Sheet6!$C$2:$C$10>0,ROW(Sheet6!$C$2:$C$10)-ROW(Sheet6!$C$2)+1)),1))}
B3{=INDEX(Sheet6!$C$2:$C$10,SMALL(IF(A3=Sheet6!$A$2:$A$10,IF(Sheet6!$C$2:$C$10>0,ROW(Sheet6!$C$2:$C$10)-ROW(Sheet6!$C$2)+1)),1))}
B4{=INDEX(Sheet6!$C$2:$C$10,SMALL(IF(A4=Sheet6!$A$2:$A$10,IF(Sheet6!$C$2:$C$10>0,ROW(Sheet6!$C$2:$C$10)-ROW(Sheet6!$C$2)+1)),1))}
C2{=INDEX(Sheet6!$B$2:$B$10,SMALL(IF(A2=Sheet6!$A$2:$A$10,IF(Sheet6!$C$2:$C$10>0,ROW(Sheet6!$C$2:$C$10)-ROW(Sheet6!$C$2)+1)),1))}
C3{=INDEX(Sheet6!$B$2:$B$10,SMALL(IF(A3=Sheet6!$A$2:$A$10,IF(Sheet6!$C$2:$C$10>0,ROW(Sheet6!$C$2:$C$10)-ROW(Sheet6!$C$2)+1)),1))}
C4{=INDEX(Sheet6!$B$2:$B$10,SMALL(IF(A4=Sheet6!$A$2:$A$10,IF(Sheet6!$C$2:$C$10>0,ROW(Sheet6!$C$2:$C$10)-ROW(Sheet6!$C$2)+1)),1))}
Press CTRL+SHIFT+ENTER to enter array formulas.



Excel 2010
ABC
1ProductOrder DateShortage
21235/2/20180
31236/15/20180
41237/17/20185
54561/1/20191
64561/2/20192
74562/2/201910
84563/3/201915
978912/1/20170
107891/1/20185
Sheet6
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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