This is a 2 step process and will require you to properly sort the table you are doing going to be looking up information. Because the Match function can only lookup 1 item, we will use the Offset function to dynamically define the range.
Step 1
Sort your data in Table 2 by CustomerID and Part# Ascending, then by Invoice Date ascending.
Step 2
Build the formula. I'm going to be indenting and using multiple lines for readability, then provide the full formula to copy and paste. I'm basing the formula on the picture. I assume the formula will be in cell C2.
INDEX(
OFFSET(
$F$2:$F$5,
MATCH(B2,$G$2:$G$5,0)-1,
0,
COUNTIFS($G$2:$G$5,B2)
),
MATCH(
A2,
OFFSET(
$E$2:$E$5,
MATCH(B2,$G$2:$G$5,0)-1
,0
,COUNTIFS($G$2:$G$5,B2)
),
1
)
)
Collapsed Excel Formula =INDEX(OFFSET($F$2:$F$5,MATCH(B2,$G$2:$G$5,0)-1,0,COUNTIFS($G$2:$G$5,B2)),MATCH(A2,OFFSET($E$2:$E$5,MATCH(B2,$G$2:$G$5,0)-1,0,COUNTIFS($G$2:$G$5,B2)),1))
Explanation
Offset allows you to dynamically select a range. In this case, because the Match function can only lookup 1 value at a time, we can use Offset to overcome this limitation.
In the Index function, we dynamically select a subset of ranges within column F by matching the CustomerID & PartID with the first occurrence of that combo in column G. The offset fuction's 4th argument allows you to select the "Height" of your range. Thus, we use CountIFs to control how big our set is. In the Match function, we do the same exact logic, but instead of looking to return column F, we are looking to return Column E. By setting this Match function to be 1, it will return the largest value it finds that is less than or equal to the lookup value.
Again, this method REQUIRES that you have your data sorted properly. If your data isn't sorted properly, you may get bad results or even falsely flagged as not found.
Here is a screenshot from my excel showing the formula in Cell C2 which currently returning 1.5
