Get Price from price list changes file on the basis of order date

exeluser1

New Member
Joined
Jun 18, 2017
Messages
6
Hi!

I have a Table 1 with price list changes for a commodity:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Date of change
[/TD]
[TD]Commodity ID
[/TD]
[TD]New Price
[/TD]
[/TR]
[TR]
[TD]2017 Jan 01[/TD]
[TD]132[/TD]
[TD]$10.5[/TD]
[/TR]
[TR]
[TD]2017 Jan 01[/TD]
[TD]150[/TD]
[TD]$20[/TD]
[/TR]
[TR]
[TD]2017 March 04[/TD]
[TD]132[/TD]
[TD]$12[/TD]
[/TR]
[TR]
[TD]2017 July 10[/TD]
[TD]132[/TD]
[TD]$15[/TD]
[/TR]
[TR]
[TD]2017 Aug 01[/TD]
[TD]150[/TD]
[TD]$25[/TD]
[/TR]
</tbody>[/TABLE]

And I have a Table 2 with orders (but w/o prices), and I need to get correct price from Table 1 on the basis of order date so it should look like (marked red):

[TABLE="width: 500"]
<tbody>[TR]
[TD]Order Date
[/TD]
[TD]Commodity ID
[/TD]
[TD]Quantity
[/TD]
[TD]Unit price[/TD]
[/TR]
[TR]
[TD]2017 Jan 03[/TD]
[TD]132[/TD]
[TD]10[/TD]
[TD]$10.5
[/TD]
[/TR]
[TR]
[TD]2017 Jan 30[/TD]
[TD]132[/TD]
[TD]10[/TD]
[TD]$10.5
[/TD]
[/TR]
[TR]
[TD]2017 Mar 05[/TD]
[TD]150[/TD]
[TD]10[/TD]
[TD]$20
[/TD]
[/TR]
[TR]
[TD]2017 Aug 15[/TD]
[TD]132[/TD]
[TD]10[/TD]
[TD]$15
[/TD]
[/TR]
[TR]
[TD]2017 Aug 20[/TD]
[TD]150[/TD]
[TD]10[/TD]
[TD]$25
[/TD]
[/TR]
</tbody>[/TABLE]


How can I do that using Excel Formulas?

Thanks!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
More explanation:
Order date (Table 2) should be compared to price change dates, and the closest from the past (Table 1) should be taken (or the same date if order date equals date of change).
 
Upvote 0

Forum statistics

Threads
1,223,921
Messages
6,175,379
Members
452,639
Latest member
RMH2024

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