Matching within results of a match

J

jg70124

Table 1 (Purchases):
Column A has a list of part numbers.
Column B has a list of purchase dates.
Column C has a list of material costs unique to the part number and
part ID.

Table 2 (Sales):
Column A has part numbers
Column B has sale dates
Column C - needs to have the purchase cost from the most recent
purchase of this part

I'd like to look up the ID in table 1 column A, then find the purchase
date closest to but before my sale date, and return the purchase cost
from table 1 column C to table 2 column C.

I know how to do array-entered sum(if..) statements, but I only know
how to get exact matches, not closest matches.

And I know how to do index(match...), but I can't figure out how to do
two matches inside one index function.

Thanks.
 
J

jg70124

I got it. For anyone who's interested, the formula is:

=INDEX('Table 1'!$c$1:$c$100,MATCH(B2,IF('table
1'!$a$1:$a$100=$A2,'table 1'!$b$1:$b$100),1))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top