Index Match Multiple conditions

LectorFiel

New Member
Joined
Apr 11, 2015
Messages
15
Dear Experts,

I am using a function Index and Match to get a value from a Table that contains some Fees.
In order to identify the right Fee, I am looking using three criteria. When I used two criteria it works, partially because I do not get error but the result is not correct totally , later I added the third one try to get the right data, but I got an Error #N/A.

Table1

Client Start date End Date Fee1
AAA 1/1/2016 12/31/2016 1
AAA 1/1/2017 12/31/2017 1.5
AAA 1/1/2018 12/31/2018 2

In Another Sheet, I have Client and Date, on this way.


Client 1/1/2016 1/1/2016 2/1/2016 3/1/2016 1/1/2017 2/1/2018
AAA X X X X
AAA
AAA
BBB
BBB
CCC

The function I am using is this : =INDEX(Table1[Fee1],MATCH(1,(Table1[Client]=$A2)*(Table1[Start Date]>=B$1),0)) and press Ctrl + Shift + Enter
This brings the first data correct when Client and Date are the same, but when date is different results belong to the next range. Which It is Wrong.

I Thought that if I add a third criteria, wondering if date is between Start Date and End Date, will help me to get the right data, but I got an Error.

=INDEX(Table1[Fee1],MATCH(1,(Table1[Client]=$A2)*(Table1[Start Date]>=B$1)*(Table1[End Date]>B$1),0)) and [FONT=arial, sans-serif]press Ctrl + Shift + Enter[/FONT]
[FONT=arial, sans-serif]I got and Error #N/A.[/FONT]

[FONT=arial, sans-serif]I appreciate your help in this matter, looks that it is easy but I really spend a lot of hours and nothing.[/FONT]

[FONT=arial, sans-serif]Thanks for your collaboration.[/FONT]
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Excel 2016
ABCDEF
1ClientStart DateEnd DateFee1
2AAA01/01/201612/31/20161
3AAA01/01/201712/31/20171.5
4AAA01/01/201812/31/20182
5BBB01/01/201612/31/20163
6BBB01/01/201812/31/20184.5
7BBB01/01/201712/31/201710
8
9
10Client01/01/201601/02/201603/01/201601/01/201702/01/2018
11AAA1111.52
12AAA1111.52
13AAA1111.52
14BBB333104.5
15BBB333104.5
16
Sheet11
Cell Formulas
RangeFormula
B11{=INDEX(Table1[Fee1],MATCH(1,(Table1[Start Date]<=B$10)*(Table1[End Date]>=B$10)*(Table1[Client]=$A11),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Make sure your Lookup value matches with the table. Make sure you don't have extra spaces in lookup value like "AAA" should not be "AAA ".
Press F2 and check the lookup value.
 
Upvote 0
Make sure your Lookup value matches with the table. Make sure you don't have extra spaces in lookup value like "AAA" should not be "AAA ".
Press F2 and check the lookup value.

Dear Nishant94, It works very very well. Thank you very much, I can see now what was my mistake, even knowing what the function can do, my mistake was the way I set the parameters. I apply your formula and it works, excellent.

Thanks again.
 
Upvote 0
or with a helpcolumn and Vlookup.

make sure you sort the date A - Z (see the orange cells)


Book1
ABCDEFG
1helpcellClientStart DateEnd DateFee1
2AAA42370AAA1-1-201612/31/20161
3AAA42736AAA1-1-201712/31/20171,5
4AAA43101AAA1-1-201812/31/20182
5BBB42370BBB1-1-201612/31/20163
6BBB42736BBB1-1-201712/31/201710
7BBB43101BBB1-1-201812/31/20184,5
8
9
10
11Client1-1-20161-2-20163-1-20161-1-20172-1-2018
12AAA1111,52
13AAA1111,52
14AAA1111,52
15BBB333104,5
16BBB333104,5
17
Blad25
Cell Formulas
RangeFormula
A2=B2&C2
C12=VLOOKUP($B12&C$11,$A$2:$E$7,5,1)
D12=VLOOKUP($B12&D$11,$A$2:$E$7,5,1)
E12=VLOOKUP($B12&E$11,$A$2:$E$7,5,1)
F12=VLOOKUP($B12&F$11,$A$2:$E$7,5,1)
G12=VLOOKUP($B12&G$11,$A$2:$E$7,5,1)
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,933
Members
449,480
Latest member
yesitisasport

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