If(Index(Match multiple criterias

Even

Board Regular
Joined
Jan 1, 2013
Messages
81
Office Version
  1. 365
Platform
  1. Windows
Hi,
I want to find and match customer with certain products. And when they match it will return either a normal % or a special % or nothing at all. There is a formula in col I, but that matches only customers that have transport. In col E I can select if it is general terms or special terms. So if it the customer and product match in columns I:M it will return either general terms or special terms.

IfIndexMatch.xlsx
ABCDEFGHIJKLM
2General terms%Special termsCustomerTransportD&OCyberCrimeArt
3Transport4,50%5,00%YesExample 15,00%
4D&O3,50%5,00%Example 2 
5Cyber3,50%5,00%YesExample 35,00%
6Crime3,50%5,00%Example 4 
7Art3,50%5,00%Example 5 
8Example 6 
9YesNoExample 74,50%
10NoExample 8 
11Example 9 
12Example 10 
All products
Cell Formulas
RangeFormula
I3:I12I3=IFERROR(IF(INDEX(Sheet1!A:A,MATCH($F3,Sheet1!A:A,0))="","",IF($E3="Yes",$C$3,IF($E3="No",$B$3,""))),"")
Cells with Data Validation
CellAllowCriteria
E3:E12List=$A$9:$A$11


IfIndexMatch.xlsx
AB
1Transport customersType of Insurance
2Example 1Art
3Example 2Crime
4Example 3Transport
5Example 4Transport
6Example 5Crime
7Example 6D&O
8Example 7D&O
9Example 8Art
10Example 9Transport
11Example 10Transport
Sheet1
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
How about
Excel Formula:
=IF(XLOOKUP($F3,Sheet1!$A$2:$A$100,Sheet1!$B$2:$B$100,"",0)=I$2,IF($E3="","",SUMIFS(IF($E3="Yes",$C$3:$C$7,$B$3:$B$7),$A$3:$A$7,I$2)),"")
 
Upvote 0
Thank you so much, Fluff!
It looks like it works very nicely. Except I get some irregularities. When I copy the formula into my workbook, it works on some columns but others not. That is weird. I have been looking it over for a long time now and I am getting tired. Do you know the reason for this?
 
Upvote 0
This is what I get
IfIndexMatch.xlsx
ABCDEFGHIJKLM
116/05/21
2General terms%Special termsCustomerTransportD&OCyberCrimeArt
3Transport4.50%5.00%YesExample 1    5.00%
4D&O3.50%5.00%Example 2     
5Cyber3.50%5.00%YesExample 35.00%    
6Crime3.50%5.00%Example 4     
7Art3.50%5.00%NoExample 5   3.50% 
8Example 6     
9YesNoExample 7 3.50%   
10NoExample 8     
11Example 9     
12NoExample 104.50%    
All products
Cell Formulas
RangeFormula
A1A1=TODAY()
I3:M12I3=IF(XLOOKUP($F3,Sheet1!$A$2:$A$100,Sheet1!$B$2:$B$100,"",0)=I$2,IF($E3="","",SUMIFS(IF($E3="Yes",$C$3:$C$7,$B$3:$B$7),$A$3:$A$7,I$2)),"")
Cells with Data Validation
CellAllowCriteria
E3:E12List=$A$9:$A$11


Is that what you would expect?
 
Upvote 0
I might have figured it out. Does the formula return the first value it finds for each customer? In my case one customer has multiple products. And I need to find every product for each customer.
Other than that it's exactly what I am looking for :)
 
Upvote 0
...but that reason doesn't sound right does it???
 
Upvote 0
Lookup functions can only return 1 match. This should do what you are asking.
Book1
ABCDEFGHIJKLM
1General terms%Special termsCustomerTransportD&OCyberCrimeArt
2Transport4.50%5.00%YesExample 1    3.50%
3D&O3.50%5.00%Example 2   5.00% 
4Cyber3.50%5.00%YesExample 34.50%    
5Crime3.50%5.00%Example 45.00%    
6Art3.50%5.00%Example 5   5.00% 
7Example 6 5.00%   
8YesNoExample 7 5.00%   
9NoExample 8    5.00%
10Example 95.00%    
11Example 105.00%    
All Products
Cell Formulas
RangeFormula
I2:M11I2=IF(COUNTIFS(Sheet1!$A:$A,$F2,Sheet1!$B:$B,I$1)>0,VLOOKUP(I$1,$A$2:$C$6,IF($E2="Yes",2,3),0),"")
 
Upvote 0
Solution
Perfect!
Lookup functions can only return 1 match. This should do what you are asking.
Book1
ABCDEFGHIJKLM
1General terms%Special termsCustomerTransportD&OCyberCrimeArt
2Transport4.50%5.00%YesExample 1    3.50%
3D&O3.50%5.00%Example 2   5.00% 
4Cyber3.50%5.00%YesExample 34.50%    
5Crime3.50%5.00%Example 45.00%    
6Art3.50%5.00%Example 5   5.00% 
7Example 6 5.00%   
8YesNoExample 7 5.00%   
9NoExample 8    5.00%
10Example 95.00%    
11Example 105.00%    
All Products
Cell Formulas
RangeFormula
I2:M11I2=IF(COUNTIFS(Sheet1!$A:$A,$F2,Sheet1!$B:$B,I$1)>0,VLOOKUP(I$1,$A$2:$C$6,IF($E2="Yes",2,3),0),"")
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,340
Members
452,638
Latest member
Oluwabukunmi

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