Caleeco
Well-known Member
- Joined
- Jan 9, 2016
- Messages
- 980
- Office Version
- 2010
- Platform
- Windows
B | C | D | E | F | G | H | I | J | |
---|---|---|---|---|---|---|---|---|---|
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]Year-Month[/TD]
[TD="align: center"]Product[/TD]
[TD="align: center"]Date[/TD]
[TD="align: right"][/TD]
[TD="align: center"]Year-Month[/TD]
[TD="align: center"]Product[/TD]
[TD="align: center"]Date[/TD]
[TD="align: center"]Defects[/TD]
[TD="align: center"]Desired output[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]201909[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]15/09/2019[/TD]
[TD="align: right"][/TD]
[TD="align: center"]201910[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]17/10/2019[/TD]
[TD="align: center"]13[/TD]
[TD="align: right"]201909[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]201907[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]29/07/2019[/TD]
[TD="align: right"][/TD]
[TD="align: center"]201907[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]15/07/2019[/TD]
[TD="align: center"]15[/TD]
[TD="align: right"]201906[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]201907[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]28/07/2019[/TD]
[TD="align: right"][/TD]
[TD="align: center"]201907[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]02/07/2019[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]201907[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]201907[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]01/07/2019[/TD]
[TD="align: right"][/TD]
[TD="align: center"]201906[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]27/06/2019[/TD]
[TD="align: center"]14[/TD]
[TD="align: right"]201806[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]201906[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]05/06/2019[/TD]
[TD="align: right"][/TD]
[TD="align: center"]201906[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]18/06/2019[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]201907[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]201906[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]03/06/2019[/TD]
[TD="align: right"][/TD]
[TD="align: center"]201905[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]01/05/2019[/TD]
[TD="align: center"]13[/TD]
[TD="align: right"]201905[/TD]
</tbody>
Sheet1
Hello,
Im struggling with a data-matching problem (which I can solve using VBA) but would prefer a formula solution.
Data Setup
- Table 1 (Column B:D) is static data. Shows different products made each month (Year-Month)
- Table 2 (Column E:J) is static data aside from Column J which needs to evaluate Table 1
The Problem
For each row I need Column J to look at Table 1 and ask the following questions:
- Have I made Part X (Column B) in the same Month as the defects occured (Column H)? > If YES, return Matched YEARAP (From Table 1 or 2)
- If I have not made Part X (Column B) in the same month as the defects occurred, find the nearest matching month that product was made > return that matched Year-AP (from Table 1)
- If Part X is not found in Table 1, return Year-AP from Column F
Worked Example
Row 2 - Part A. Was not made in October (Table 1) > It is found in Table 1 > Nearest Matching month is September > Return 201909.
Is this possible? Any help is appreciated as always
Many Thanks
Caleeco