Retrieve the latest Price

stormspike

New Member
Joined
Oct 9, 2014
Messages
2
It is hard for me to describe what exactly I am looking for. Perhaps it is best that I try to illustrate it with my example.

A1: Date
A2: 10/1/2014
A3: 10/2/2014
A4: 10/9/2014
A5: 10/10/2014

B1: SKU
B2: T001
B3: T002
B4: T001
B5: T002

C1: PRICE
C2: 12
C3: 5
C4: 13
C5: 6


Suppose, A8 is my date criteria=10/1/2014, B8 is my SKU criteria=T001, C8 should return 12.
Suppose, A9 is my date criteria=10/4/2014, B9 is my SKU criteria=T001, C9 should return 12.
Suppose, A10 is my date criteria=10/9/2014, B10 is my SKU criteria=T001, C10 should return 13.

How do I write the formula on the C column so that Excel will always return the latest price based on the date that I have input on A column?

I tried to use the following formula
=INDEX($A$2:$C$5,MATCH($A$8&$B$8,$A$2:$A$5&$B$2:$B$5,1),3)

But the results get mixed up because MATCH is trying to find the closest match based on DATE but will also try to find the closest match based on SKU as well. I need MATCH to find the latest date but must find the exact SKU.

How do I go about from here? Hope some gurus can shed some lights.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
C8, control+shift+enter, not just enter, and copy down:

=LOOKUP($A8,IF($B$2:$B$5=$B8,$A$2:$A$5),$C$2:$C$5)
 
Upvote 0

Forum statistics

Threads
1,216,150
Messages
6,129,154
Members
449,488
Latest member
qh017

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