Last price paid for a product, prior to a certain date - Formula

jwb1012

Board Regular
Joined
Oct 17, 2016
Messages
167
Hello, I have a table with historical purchase history (i.e. prices paid for various products over time). Then I have another table, the "product request table", where I need to use a formula to pull in the most recent price paid for a product as of a certain date (not including purchases made after that date). The purchasing data will have purchases +/- the dates in the "product request table".

I cant think of a great way to accomplish this. Any thoughts?

[TABLE="class: grid, width: 495"]
<tbody>[TR]
[TD]Product Requested
[/TD]
[TD]Date Requested
[/TD]
[TD]Last Price Paid
[/TD]
[/TR]
[TR]
[TD]Apple
[/TD]
[TD]10/10/2016
[/TD]
[TD]<insert Formula=""></insert>
[/TD]
[/TR]
[TR]
[TD]Peach
[/TD]
[TD]10/10/2016
[/TD]
[TD]<insert Formula=""></insert>
[/TD]
[/TR]
[TR]
[TD]---------------------
[/TD]
[TD]-----------------
[/TD]
[TD]-------------------
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Product Purchased
[/TD]
[TD]Date Purchased
[/TD]
[TD]Price Paid
[/TD]
[/TR]
[TR]
[TD]Apple
[/TD]
[TD]7/10/2016
[/TD]
[TD]$1.00
[/TD]
[/TR]
[TR]
[TD]Apple
[/TD]
[TD]8/10/2016
[/TD]
[TD]$1.10
[/TD]
[/TR]
[TR]
[TD]Apple
[/TD]
[TD]9/10/2016
[/TD]
[TD]$1.21
[/TD]
[/TR]
[TR]
[TD]Apple
[/TD]
[TD]11/10/2016
[/TD]
[TD]$1.33
[/TD]
[/TR]
[TR]
[TD]Peach
[/TD]
[TD]7/10/2016
[/TD]
[TD]$2.00
[/TD]
[/TR]
[TR]
[TD]Peach
[/TD]
[TD]8/10/2016
[/TD]
[TD]$2.20
[/TD]
[/TR]
[TR]
[TD]Peach
[/TD]
[TD]9/10/2016
[/TD]
[TD]$2.42
[/TD]
[/TR]
[TR]
[TD]Peach
[/TD]
[TD]11/10/2016
[/TD]
[TD]$2.66
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try the following formula (to be entered using Ctrl+Shift+Enter, not just Enter):

=LOOKUP($B2,IF($A$8:$A$15=$A2,$B$8:$B$15),IF($A$8:$A$15=$A2,$C$8:$C$15))
 
Upvote 0
Very interesting... it works... can you please explain how/what this formula is doing in simple terms? Not sure I understand.
 
Upvote 0
In simple terms: it looks for the latest Apple-related date that does not exceed the 'Date Requested', and returns the corresponding value from the Apple-related array of prices.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

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