Matching Product Costs Using Product ID and Dates (multiple ID with varied Dates)

k______S

New Member
Joined
May 12, 2017
Messages
7
Hello,

I have a file A with product ID's and the date they were sold. I have another file B with the historical cost of these products and the dates the cost was changed/updated.

I need to find the pricing for the products ID's in file A on the date they were sold (also in File A). Is there a way to use the data from File B (the dates will not match up exactly) to find the historical pricing for File A?

EX:

File A has a product ID of 1234 and was sold on 10/01/2018
File B has product ID 1234 on two lines. Line 1 has a price of $4.25 and a date of 04/01/2018 and line 2 has a price of $4.50 with a date of 12/31/2018.

This means that the price of product 1234 was $4.25 from 04/01/2018 through 12/30/2018. On 12/31/2018 the price changed to $4.50.

How can I use these two files to match the date on File A to the time range on File B and return the correct price?

Please let me know if you need additional information
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Book1
ABC
1Product IDSoldPrice
212344/1/20184.25
3123412/31/20184.5
4
5
6
7
8
9
10
Sheet1


The dates are assumed to be chronological in FileB.


Book1
ABC
1Product IDSoldPrice
2123410/1/20184.25
3
4
Sheet1


In C2 of Sheet1 in File A, control+shift+enter, not just enter:

=LOOKUP(B2,IF([FileB.xlsx]Sheet1!$A$2:$A$10=$A2,[FileB.xlsx]Sheet1!$B$2:$B$10),[FileB.xlsx]Sheet1!$C$2:$C$10)
 
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,565
Members
449,038
Latest member
Guest1337

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