vlookup - first subsequent/previous cell value if searched value not found

GregMax

New Member
Joined
Oct 3, 2017
Messages
2
Hello,

please I need help with one problem.

I have currency list for a period and specific dates I need to get the currency for.
E.g.
A B
24.07.2017 7,4098 kn
21.07.2017 7,4110 kn
20.07.2017 7,4103 kn
19.07.2017 7,4143 kn
13.07.2017 7,4138 kn
11.07.2017 7,4111 kn

If date is e.g. 19.07.2017 (in A8) the searched value, with vlookup formula VLOOKUP(A8; $A$1:$B$6;2;FALSE) (in B8) would give 7,4143 kn.

But when I have e.g. 23.7.2017 the vlookup function displays #n/a, because for that date there is no currency value. In these cases, how can I edit formula to search for first previous valid date and displays currency value from that date? In this case this would be 21.7.2017 and value I would need is 7,4110kn.

I assume it is simple solution, but....

thx!!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
order the table from earliest to latest date
and use
=VLOOKUP(A8,$A$1:$B$6,2,TRUE)
 
Upvote 0
quick answer is to sort you list from oldest date to newest date Ie: 11.07.2017 in A1 and 24.07.2017 in A6. then remove the false from your formula.

hth,

Ross
 
Upvote 0
Excel Workbook
ABC
111/07/201774,111kn
213/07/201774,138kn
319/07/201774,143kn
420/07/201774,103kn
521/07/201774,110kn
624/07/201774,098kn
7
823/07/2017#N/A74110
Sheet1
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,232
Members
449,092
Latest member
SCleaveland

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