Vlookup same item but after certain date

ExcelNoob222

Board Regular
Joined
Jun 17, 2020
Messages
77
Office Version
  1. 365
Platform
  1. Windows
Hi all, I have two sets of data and I need to vlookup from one to the other. The problem is dates.

First table:

ItemDatePrice
1​
1-Jan-21​
6​
1​
15-Jan-21​
10​
1​
25-Jan-21​
14​

My second set of data:

ItemDateAdjusted Price
1​
1-Jan-21​
7​
1​
2-Jan-21​
9​
1​
5-Jan-21​
9.5​
1​
19-Jan-21​
11.75​
1​
24-Jan-21​
12​
1​
26-Jan-21​
14.5​
1​
28-Jan-21​
16​


I need to vlookup the adjustd price column from the second set of data into the first set. However, I only want the row for each item that is on or after the same date from the first table. As an example my combined data would like this:

ItemDatePriceVlookup
1​
1-Jan-21​
6​
7​
1​
15-Jan-21​
10​
11.75​
1​
25-Jan-21​
14​
14.5​
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi,

Assuming first table range = A1:C4
second table range = A10:C17
try this in D2

Excel Formula:
=VLOOKUP(MIN(FILTER(B10:B17, B10:B17>=B2)),B10:C17,2,0)
 
Upvote 0
Try this:

Dante Amor
ABCDEFGHI
1ItemDatePriceVlookupItemDateAdjusted Price
2101/01/202167101/01/20217
3115/01/20211011.75102/01/20219
4125/01/20211414.5105/01/20219.5
5119/01/202111.75
6124/01/202112
7126/01/202114.5
8128/01/202116
Hoja1
Cell Formulas
RangeFormula
D2:D4D2=INDEX($I$2:$I$8,MIN(IF($H$2:$H$8>=B2,ROW($I$2:$I$8)))-ROW($I$1))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi,

Assuming first table range = A1:C4
second table range = A10:C17
try this in D2

Excel Formula:
=VLOOKUP(MIN(FILTER(B10:B17, B10:B17>=B2)),B10:C17,2,0)

Hi! Thank you for your answer. This did work, however, I should have mentioned my actual data has more than one item. So the same problem happens again but with item 2, then 3 and so on. Is there a way to adjust this formula to also factor in the item number? Some items will have the same date on the first list but a different date on the second list so I think I will get the wrong info if I do not factor in the item.

Thank you!!
 
Upvote 0
Try this:

Dante Amor
ABCDEFGHI
1ItemDatePriceVlookupItemDateAdjusted Price
2101/01/202167101/01/20217
3115/01/20211011.75102/01/20219
4125/01/20211414.5105/01/20219.5
5119/01/202111.75
6124/01/202112
7126/01/202114.5
8128/01/202116
Hoja1
Cell Formulas
RangeFormula
D2:D4D2=INDEX($I$2:$I$8,MIN(IF($H$2:$H$8>=B2,ROW($I$2:$I$8)))-ROW($I$1))
Press CTRL+SHIFT+ENTER to enter array formulas.

Hi, Great answer! This did work but just like the other suggestion, it does not use the item number. So the same problem happens again but with item 2, then 3 and so on. Is there a way to adjust this formula to also factor in the item number? Some items will have the same date on the first list but a different date on the second list so I think I will get the wrong info if I do not factor in the item.
 
Upvote 0
To factor in the item number we need to change the filter part, like this

Excel Formula:
=VLOOKUP(MIN(FILTER(B10:B17, (B10:B17>=B2)*(A10:A17=A1))),B10:C17,2,0)
 
Upvote 0
it does not use the item number

Try this:
Dante Amor
ABCDEFGHI
1ItemDatePriceVlookupItemDateAdjusted Price
2101/01/202167101/01/20217
3115/01/20211011.75102/01/20219
4125/01/20211414.5105/01/20219.5
5201/01/202169.5119/01/202111.75
6124/01/202112
7126/01/202114.5
8128/01/202116
9201/01/20219.5
10202/01/202111.5
11205/01/202112
12219/01/202114.25
Hoja4
Cell Formulas
RangeFormula
D2:D5D2=INDEX($I$2:$I$12,MIN(IF(($H$2:$H$12>=B2)*($G$2:$G$12=A2),ROW($I$2:$I$12)))-ROW($I$1))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
To factor in the item number we need to change the filter part, like this

Excel Formula:
=VLOOKUP(MIN(FILTER(B10:B17, (B10:B17>=B2)*(A10:A17=A1))),B10:C17,2,0)

Hi! So this gave me the correct results for the first item but once the formula reached the second test item, it brought back the price for item 1 and not item 2.
 
Upvote 0
Try this:
Dante Amor
ABCDEFGHI
1ItemDatePriceVlookupItemDateAdjusted Price
2101/01/202167101/01/20217
3115/01/20211011.75102/01/20219
4125/01/20211414.5105/01/20219.5
5201/01/202169.5119/01/202111.75
6124/01/202112
7126/01/202114.5
8128/01/202116
9201/01/20219.5
10202/01/202111.5
11205/01/202112
12219/01/202114.25
Hoja4
Cell Formulas
RangeFormula
D2:D5D2=INDEX($I$2:$I$12,MIN(IF(($H$2:$H$12>=B2)*($G$2:$G$12=A2),ROW($I$2:$I$12)))-ROW($I$1))
Press CTRL+SHIFT+ENTER to enter array formulas.

Awesome, this worked! Thank you!
 
Upvote 0

Forum statistics

Threads
1,214,959
Messages
6,122,476
Members
449,087
Latest member
RExcelSearch

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