Lookup result from Date Range

Eaden

New Member
Joined
Apr 4, 2011
Messages
3
Hi,

Anyone out there know how I get an vlookup result where the 'lookup value' is conditional whether it falls between 2 dates.


I have 3 columns of data to search upon and I want to return the resultant in column C.
  • Cost From---Cost To-----Cost Period
  1. 01/08/11-----28/08/11-----Y1011_P05
  2. 29/08/11-----25/09/11-----Y1011_P06
  3. 26/09/11-----30/10/11-----Y1011_P07
Therefore the formula looking up a value of 30/8/11 would return a result of Y1011_P06.

Much appreciated
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
If the Cost From dates are in chronological order, VLOOKUP will find the closest match that doesn't exceed the lookup value.

<br /><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="font-weight: bold;text-align: center;;">Cost From</td><td style="font-weight: bold;text-align: center;;">Cost To</td><td style="font-weight: bold;text-align: center;;">Cost Period</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;;">01/08/2011</td><td style="text-align: center;;">28/08/2011</td><td style="text-align: center;;">Y1011_P05</td><td style="text-align: right;;"></td><td style="text-align: center;background-color: #FFFF00;;">30/08/2011</td><td style="text-align: center;background-color: #FFFF99;;">Y1011_P06</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;;">29/08/2011</td><td style="text-align: center;;">25/09/2011</td><td style="text-align: center;background-color: #FFFF99;;">Y1011_P06</td><td style="text-align: right;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;;">26/09/2011</td><td style="text-align: center;;">30/10/2011</td><td style="text-align: center;;">Y1011_P07</td><td style="text-align: right;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr></tbody></table><br /><br /><table cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">F3</th><td style="text-align:left">=VLOOKUP(<font color="Blue">E3,A:C,3,</font><font color="Red">1</font>)</td></tr></tbody></table></td></tr></table><br />

Note the last argument (1) in the VLOOKUP Formula that indicates find closest match.
 
Upvote 0
I have been lookihng at this all morning, and the phrase "can't see the wood for the trees" springs to mind.

For some reason I thought it had to be more complicated than this...

Very embarrasing

Very much appreciated nonetheless.

Philip
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
Lawrenceiow

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