Index and Match with three conditions

josvill2010

New Member
Joined
Jun 1, 2011
Messages
40
Office Version
  1. 365
Hi,
I have tried to add another condition to this index formula as I have noted sometime the number that I am looking for eg A purchase order (PO) number might appear twice under a different label (GL).
The PO might have two different values for the two different labels. The formula also bring the information of the month of when the PO was used.
For example
This formula is working
=INDEX('Open PO'!$A:$X,MATCH($C20,'Open PO'!$G:$G,0),MATCH(T$11,'Open PO'!$A$3:$X$3,0))
But then I need help with adding another criteria.

=INDEX('Open PO'!$A:$X,MATCH(1,($C20='Open PO'!$G:$G)*($C16='Open PO'!E:E),0),(T$11='Open PO'!$A$3:$X$3))
I want to add the criteria for the GL so it brings a different line but it is not working

Excel to test.xlsx
BCDEFGHIJKLMNOPQRST
11POSupplierTitleDescriptionRequestorNeed byAmountBilledUnbilledRun RateQ2'20Q3'20Q4'20Q1'21Q2'21Q3'21Q4'21Q1'22
12
13
14CLN2010 - VEHICLES (LEASES & PURCHASES) - OPEX-11,49423,7825,3664,5314,3965,0793,335
15POSupplierTitleDescriptionRequestorNeed byAmountBilledUnbilledRun Rate
16CLNGL EQUIPMENT------45,99935,075
17POSupplierTitleDescriptionRequestorNeed byAmountBilledUnbilledRun Rate
1870000156486test 1 test 2test 3test 4test 5test 6test 7test 8test 9--------
1970000059248test 1 test 2test 3test 4test 5test 6test 7test 8test 9--------
2070000012329test 1 test 2test 3test 4test 5test 6test 7test 8test 9---4,3974,5314,3965,079$3,335
21EMEA
CLN
Cell Formulas
RangeFormula
T20T20=INDEX('Open PO'!$A:$X,MATCH($C20,'Open PO'!$G:$G,0),MATCH(T$11,'Open PO'!$A$3:$X$3,0))
T21:AQ21T21=INDEX('Open PO'!$A:$X,MATCH(1,($C20='Open PO'!$G:$G)*($C16='Open PO'!E:E),0),(T$11='Open PO'!$A$3:$X$3))
Dynamic array formulas.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Could you provide a short example of the "Open PO" worksheet? And could you clarify something, please? While the PO number may appear multiple times, do you expect that it will appear only once for a particular label?
 
Upvote 0
Excel to test.xlsx
ABCDEFGHIJKLMNOPQRSTUVWX
1123456789101112131415161718192021222324
2EMEAACTUALS By PO1620202020202020212021202120212022
3RegionSiteSupplierLevel 0 DPCLevel 1RequestorPO #AmountUnbilledBilledNeed ByTime %Billed %TitleDescriptionRun RateQ2'20Q3'20Q4'20Q1'21Q2'21Q3'21Q4'21Q1'22
54EMEATEST A HEIGHT FOR HIRE LTDMTRLSGL TOOLSJoe B2013281500001500485002/28/2022100%97%Test1Test1$0$0$0$0$0$0$0$0$0
55EMEATEST A HEIGHT FOR HIRE LTDMTRLSNO GL EQUIPMENTJoe B70000012329100000100002/28/2022100%100%Test1Test1$0$0$0$0$0$0$0$0$3,335
56EMEATEST A HEIGHT FOR HIRE LTDMTRLSGL EQUIPMENTJoe B7000001232915000900060002/28/2022100%40%Test2Test2$0$0$0$0$0$0$0$0$0
Open PO
Cell Formulas
RangeFormula
J54:J56J54=H54-I54
M54:M56M54=J54/H54
 
Upvote 0
Copy of the formulas

Excel to test.xlsx
BCDEFGHIJKLMNOPQRST
11CompanyPOSupplierTitleDescriptionRequestorNeed byAmountBilledUnbilledRun RateQ2'20Q3'20Q4'20Q1'21Q2'21Q3'21Q4'21Q1'22
12
13
14TEST A NO GL EQUIPMENT-11,49423,7825,3664,5314,3965,0793,335
15POSupplierTitleDescriptionRequestorNeed byAmountBilledUnbilledRun Rate
16TEST A GL EQUIPMENT------45,99935,075
17POSupplierTitleDescriptionRequestorNeed byAmountBilledUnbilledRun Rate
1870000156486test 1 test 2test 3test 4test 5test 6test 7test 8test 9--------
1970000059248test 1 test 2test 3test 4test 5test 6test 7test 8test 9--------
2070000012329test 1 test 2test 3test 4test 5test 6test 7test 8test 9---4,3974,5314,3965,079$3,335
21EMEA
TEST A
Cell Formulas
RangeFormula
T20T20=INDEX('Open PO'!$A:$X,MATCH($C20,'Open PO'!$G:$G,0),MATCH(T$11,'Open PO'!$A$3:$X$3,0))
T21T21=INDEX('Open PO'!$A:$X,MATCH(1,($C20='Open PO'!$G:$G)*($C16='Open PO'!E:E),0),(T$11='Open PO'!$A$3:$X$3))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Try it like
Excel Formula:
=INDEX('Open PO'!$A:$X,MATCH(1,($C20='Open PO'!$G:$G)*($C16='Open PO'!E:E),0),MATCH(T$11,'Open PO'!$A$3:$X$3,0))
 
Upvote 0
Solution
it worked without flaws.

Why do I need to use use match(1,..)
I tried to multiply both Match for rows, but it didnt work
This is the formula i tried by copying yours
=INDEX('Open PO'!$A:$X,(MATCH(C20,'Open PO'!G:G,0)*MATCH(C16,'Open PO'!E:E,0)),MATCH(T$11,'Open PO'!$A$3:$X$3,0))
Yours:
=INDEX('Open PO'!$A:$X,MATCH(1,($C20='Open PO'!$G:$G)*($C16='Open PO'!E:E),0),MATCH(T$11,'Open PO'!$A$3:$X$3,0))
 
Upvote 0
I just copied you T21 formula & change the column argument back to using match, as you had in T20
 
Upvote 0

Forum statistics

Threads
1,215,732
Messages
6,126,540
Members
449,316
Latest member
sravya

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