# VLOOKUP or INDEX/MATCH Date Range and Multiple Criteria

#### ariannem

##### New Member
Hi, I'm trying to match two data ranges by date and client number, but all my VLOOKUP and INDEX MATCH formulas are coming up #N/A, so I was wondering if someone could help me out.

My two data ranges look like the following image (the actual data is several thousand rows in size, this is just an example)

Basically, what I want to do is match the date in column I to the date ranges in A and B, and the client number in J has to match the client number in C.
If date I falls between A and B, and client number J matches client number C, I want the number in D to show up in L.
In other words, L2 would show up as "A1" and L3 would be "C3".

I've tried using an array formula: =index (\$D\$2:\$D\$5, match (1, ((I2>=\$A\$2:\$A\$5)*(I2<=\$B\$2:\$B\$5)*(J2=\$C\$2:\$C\$5)), 0))
and a similar function using VLOOKUP, but both have failed to work.

### Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

#### etaf

##### Well-known Member
are the dates REAL dates formatted to YYYY/M/D or are they TEXT
If TEXT than >= or <= will not work.
to check
right click on a date cell and format as General - You should see a number
for example
2020/1/1 as a date 1st Jan 2020 would be 43831 as a Number

#### ariannem

##### New Member
Hi etaf, thanks for the reply.

The dates are all real dates formatted as yyyy/mm/dd, and they turn into numbers when formatted as general.

#### Fluff

##### MrExcel MVP, Moderator
There's nothing wrong with the formula
+Fluff New.xlsm
ABCDEFGHIJKL
1
201/01/202031/01/20201a107/01/20201a1
301/02/202003/02/20201a208/09/20202a3
402/09/202015/09/20202a3
5
Results
Cell Formulas
RangeFormula
L2:L3L2=INDEX(\$D\$2:\$D\$5,MATCH(1,((I2>=\$A\$2:\$A\$5)*(I2<=\$B\$2:\$B\$5)*(J2=\$C\$2:\$C\$5)),0))
Press CTRL+SHIFT+ENTER to enter array formulas.

Check that your numbers are real numbers & not text

Replies
3
Views
89
Replies
15
Views
128
Replies
21
Views
243
Replies
8
Views
244
Replies
5
Views
104