INDEX and MATCH with multiple criteria

wildturkey

Board Regular
Joined
Feb 21, 2006
Messages
189
Office Version
  1. 365
Platform
  1. Windows
Struggling to get the foloowing work in Column L..Basically if I can match the value in column K in column C and any of those instances have "Sur" in Colum H then Id like to flag this in Colum L....

Surcharge2.xlsx
ABCDEFGHIJKLMNO
1AccountDateDocument NumberCustomerStatusTotal RevenueItem: NameSurchargeDocument NumberSUR-1kgSur
2Sales Orders27/09/2021SO30298644684830 BBilled6.67DEL1STDFSD SO3029860SUR-3kgSur
3Sales Orders27/09/2021SO30298644684830 BBilled55.2FS1233 SO3029870SUR-6kgSur
4Sales Orders27/09/2021SO30298644684830 BBilled12.37S-GB SO3029880SUR-9kgSur
5Sales Orders27/09/2021SO30298744684831 MBilled6.67SUR-3kgSurSO3029890
6Sales Orders27/09/2021SO30298744684831 MBilled222.6FS1234 00
7Sales Orders27/09/2021SO30298744684831 MBilled45.85S-GB 0
8Sales Orders27/09/2021SO30298844684832 JBilled6.67DEL1STDFSD 
9Sales Orders27/09/2021SO30298844684832 JBilled166.32IPBF05 
10Sales Orders27/09/2021SO30298844684832 JBilled34.59S-GB 
11Sales Orders27/09/2021SO30298944684832 JBilled4.15DEL1ECO 
12Sales Orders27/09/2021SO30298944684832 JBilled12.5SUR-3kgSur
report369
Cell Formulas
RangeFormula
K1:K6K1=UNIQUE(C:C)
L2:L7L2=INDEX(H:H,MATCH(1,("sur"=H:H)*(K2=C:C)),0)
F2,F5,F8F2=6.67
F3F3=55.2
F4F4=12.37
F6F6=222.6
F7F7=45.85
F9F9=166.32
F10F10=34.59
F11F11=4.15
F12F12=12.5
H2:H12H2=IFERROR(INDEX($O$1:$O$4,MATCH(G2,$N$1:$N$4,0)),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
Dynamic array formulas.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
What actual results would you want in L2:L6 for that sample data?

Is column H simply marking rows that start with "SUR" in column G, or are their some "SUR ... " values in column G that do not get marked because they don't match with the values in column N?
 
Upvote 0
Would like "sur" to be shown in L2:L6 please if both the SO number is shown in C and "sur" is shown in H please. There will be no SUR... in Column G that are not in N
 
Upvote 0
In that case, unless you need it for something else, you do not need column H as far as I can see (or possibly columns N:O)

I would also recommend against using whole column ranges. In some cases that will force Excel to evaluate over 1 millions cells in each row, putting a significant burden on the calculation process.

See if this is what you want.

wildturkey.xlsm
CDEFGHIJKL
1Document NumberCustomerStatusTotal RevenueItem: NameDocument Number 
2SO30298644684830 BBilled6.67DEL1STDFSDSO302986
3SO30298644684830 BBilled55.2FS1233SO302987sur
4SO30298644684830 BBilled12.37S-GBSO302988
5SO30298744684831 MBilled6.67SUR-3kgSO302989sur
6SO30298744684831 MBilled222.6FS1234
7SO30298744684831 MBilled45.85S-GB
8SO30298844684832 JBilled6.67DEL1STDFSD
9SO30298844684832 JBilled166.32IPBF05
10SO30298844684832 JBilled34.59S-GB
11SO30298944684832 JBilled4.15DEL1ECO
12SO30298944684832 JBilled12.5SUR-3kg
13
Sheet1
Cell Formulas
RangeFormula
K1:K5K1=UNIQUE(FILTER(C1:C1000,C1:C1000<>""))
L1:L5L1=IF(COUNTIFS(C$2:C$1000,K1#,G2:G1000,"SUR*"),"sur","")
Dynamic array formulas.
 
Upvote 0
Solution
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,442
Messages
6,172,151
Members
452,445
Latest member
walkman99

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