VLOOKUP or INDEX/MATCH Date Range and Multiple Criteria

ariannem

New Member
Joined
Sep 28, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
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.

Any suggestions? Thanks in advance!

002.PNG
 

Some videos you may like

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
Joined
Oct 24, 2012
Messages
4,025
Office Version
  1. 365
Platform
  1. MacOS
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
Joined
Sep 28, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
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
Joined
Jun 12, 2014
Messages
47,955
Office Version
  1. 365
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,112,865
Messages
5,542,960
Members
410,579
Latest member
bdubz
Top