Vlookup between specific dates

Lazyh0rse

New Member
Joined
Nov 7, 2018
Messages
8
Hi all

I need to apply price changes to diesel in a fleet based on the date that the change occurred.

So in my mind I need a formula in column C that multiplies that value in column B with the correct price value in column F based on the date.

I hope you can help.

ABCDEF
1Fill up DateDiesel LitresPricePrice Change DateNew Price
22018/08/01233,00 2018/08/0113,31
32018/08/15265,69 2018/09/1214,49
42018/08/20225,00 2018/10/1814,99
52018/08/27270,00
62018/08/30167,00
72018/09/05235,80
82018/09/12154,82
92018/09/19270,00
102018/09/27280,10
112018/10/04218,10
122018/10/11237,80
132018/10/18230,10
142018/10/24320,0
152018/10/31208,5
162018/11/07272,1

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi there. Put this formula in C2 and then copy down: =VLOOKUP(A2,E:F,2,TRUE)

Regards
John
 
Upvote 0
You're welcome. I should have explained it a bit - the TRUE option tells excel to find an approximate match, so it looks for the highest date less than or equal to the date in A2. Make sure you always keep the price changes in ascending date order or you may get unexpected results.
 
Upvote 0

Forum statistics

Threads
1,216,434
Messages
6,130,611
Members
449,584
Latest member
c_clark

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