# VLookup or index/match help with date ranges in criteria

#### saboorsas

##### New Member
Book1
ABCDEFG
1Sales
2Sales NoProductPurchase DateSale DateSales ValuePurchase ValueMargin
31Baked Beans15/08/200616/08/20060
42Baked Beans15/08/200603/09/20060
53Salt Beef02/09/200615/09/20060
6
7
8Purchase Values
9ProductDate fromDate toValue
10Baked Beans01/08/200631/08/200610
11Macaroni01/07/200631/07/20062
12Salt Beef38,96130/09/200611
13
14
15Sales Values
16ProductDate fromDate toValue
17Baked Beans01/08/200631/08/200612
18Baked Beans01/09/200630/09/200617
19Salt Beef01/09/200630/09/200622
Sheet1

Umm, 3rd time lucky?

I have 2 sets of data from which I am trying to match information into a 3rd range (as demonstartated above). I'm familair with index/match as well a vlookup. My problem this time is that there are date ranges involved. Not too sure where to start.
Also, not too sure if this is releavnt place to post but, would this be easier done in Access?

### Excel Facts

If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
One way would be to use this formula in E3 copied down

=LOOKUP(2,1/((A\$17:A\$19=\$B3)*(B\$17:B\$19<=\$D3)*(C\$17:C\$19>=\$D3)),D\$17:D\$19)

with a similar formula in F3

Hi,

In E3,

=LOOKUP(2,1/((\$A\$17:\$A\$19=B3)*(D3>=\$B\$17:\$B\$19)*(D3<=\$C\$17:\$C\$19)),\$D\$17:\$D\$19)

F3,

=LOOKUP(2,1/((\$A\$10:\$A\$12=B3)*(C3>=\$B\$10:\$B\$12)*(C3<=\$C\$10:\$C\$12)),\$D\$10:\$D\$12)

HTH

I tried the formulae.

Many thanks. I'm trying to understand how the formula works. What is the significance of the following:

1/((\$A\$17:\$A\$19=B5)*(D5>=\$B\$17:\$B\$19)*(D5<=\$C\$17:\$C\$19))

Replies
2
Views
256
Replies
5
Views
353
Replies
3
Views
286
Replies
12
Views
767
Replies
2
Views
304

1,217,753
Messages
6,138,416
Members
450,135
Latest member
IsidroGil

### 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?

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