Index and Match

josvill2010

New Member
Joined
Jun 1, 2011
Messages
40
Office Version
  1. 365
HI Everybody,
There is a table that contains all information that I need to build another table.
At the moment I am searching manually and bringing the value from the other table across.
I was hoping to automate but the problem is that the search element has different values underneath in a different row and then in the next table.
I would like to bring this values across but I cannot remember how to ask the formula to bring the values below the Matching cell, and then from two columns to the right.
Attached is the example
TestingExcelFormula.xlsx
ABCDEF
1PO #RequestorSupplier2001-GL1
2000
3000
4
5
60002001-GL2
Formula
Cell Formulas
RangeFormula
A2A2=INDEX(test!D:D,MATCH(F1,test!C:C,0))
B2B2=INDEX(test!F:F,MATCH(F1,test!C:C,0))
C2C2=INDEX(test!E:E,MATCH(F1,test!C:C,0))
A3A3=INDEX(test!D:D,MATCH(F1,test!C:C,0))
B3B3=INDEX(test!F:F,MATCH(F1,test!C:C,0))
C3C3=INDEX(test!E:E,MATCH(F1,test!C:C,0))
A6A6=INDEX(test!D:D,MATCH(F6,test!C:C,0))
B6B6=INDEX(test!F:F,MATCH(F6,test!C:C,0))
C6C6=INDEX(test!E:E,MATCH(F6,test!C:C,0))





TestingExcelFormula.xlsx
ABCDEFG
1
2L1Test12001-GL1
3GLPO#SupplierRequesterPO Header Description
42001-GL1100001Company1JoePO Great
52001-GL1100002Company2MichaelPO Great 2
62001-GL1100003Company3David PO Great 3
7
8L1Test12001-GL2
9GLSupplierRequesterPO Header Description
102001-GL2100004Company4RichardPO Great 4
11
test
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Based on the example provided, try
Book1
ABCDEFG
2L1Test12001-GL1
3GLPO#SupplierRequesterPO Header Description
42001-GL1100001Company1JoePO Great
52001-GL1100002Company2MichaelPO Great 2
62001-GL1100003Company3David PO Great 3
7
8L1Test12001-GL2
9GLSupplierRequesterPO Header Description
102001-GL2100004Company4RichardPO Great 4
11
12100001JoeCompany12001-GL1
13100002MichaelCompany22001-GL1
14100003David Company32001-GL1
15100004RichardCompany42001-GL2
Sheet1
Cell Formulas
RangeFormula
B12:E15B12=INDEX(FILTER(C2:F10,(C2:C10<>"GL")*(D2:D10<>""),""),SEQUENCE(COUNTIFS(C2:C10,"<>GL",D2:D10,"<>")),{2,4,3,1})
Dynamic array formulas.
 
Upvote 0
Based on the example provided, try
Book1
ABCDEFG
2L1Test12001-GL1
3GLPO#SupplierRequesterPO Header Description
42001-GL1100001Company1JoePO Great
52001-GL1100002Company2MichaelPO Great 2
62001-GL1100003Company3David PO Great 3
7
8L1Test12001-GL2
9GLSupplierRequesterPO Header Description
102001-GL2100004Company4RichardPO Great 4
11
12100001JoeCompany12001-GL1
13100002MichaelCompany22001-GL1
14100003David Company32001-GL1
15100004RichardCompany42001-GL2
Sheet1
Cell Formulas
RangeFormula
B12:E15B12=INDEX(FILTER(C2:F10,(C2:C10<>"GL")*(D2:D10<>""),""),SEQUENCE(COUNTIFS(C2:C10,"<>GL",D2:D10,"<>")),{2,4,3,1})
Dynamic array formulas.
Thanks for the help. I think this a couple of level ups from me.
Can you help me to understand what the formula does?

I see the filter C2:F10 is the sample.
C2:C10<>"GL" and x (D2:D10<>""). First part is find whatever doesn't have GL in Colum C2 to C10 and then multiply by whatever you find in D2 to D10 that is not zero.
,"") not sure what that does.

Sequence(Countifs(C2:C10,"<>GL",D2:D10,"<>")). Count the what is not GL in Column C and what it has a number in column D.
The last part is to bring the order of what the sample has.

I would like to bring the table but limit to the GL in column F. So I can create a sum for all the PO that I bring under each GL.
Can I link the C2:C10<>"GL" and x (D2:D10<>"") to F1 eg C2:C10=f1
 
Upvote 0
This is the error I am getting in cell A2 . It can read the lines but it doesn't bring any of the information like Supplier, requestor.
It seems the number of rows that brings is correct.
Any suggestions? is it a problem with Sequence, the filter, or the Index?

TestingExcelFormula.xlsx
ABCDEFGHIJKLMNOPQRSTU
1SupplierRequestorAmountRemaining=INDEX(test!F:F,MATCH(F1,test!C:C,0))L1Test11234567AmountRemaining
2#N/A#N/A#N/A#N/A2001-CONSUMABLES
3#N/A#N/A#N/A#N/A
4#N/A#N/A#N/A#N/A
52001-CONSUMABLES
6#N/A#N/A#N/A#N/A2002-TOOLS SupplierRequesterPO Header DescriptionCreate DateNeed by DateLast Activity DatePO Line Order Amt USDAmt Billed USD
7L1Test12001-CONSUMABLES2020214SupplierRequester10000075000
82001-CONSUMABLES70000027165SupplierRequester9000065000
92001-CONSUMABLES70000049091SupplierRequester8000055000
10
11#N/A#N/A#N/A#N/A2003-ELEC
12SupplierRequesterPO Header DescriptionCreate DateNeed by DateLast Activity DatePO Line Order Amt USDAmt Billed USD
132002-TOOLS 2013281SupplierRequester7000045000
Formula PO (3)
Cell Formulas
RangeFormula
A2:D4,A6:D6A2=INDEX(FILTER($K:$U,($K:$K=$F2)*($L:$L<>""),""),SEQUENCE(COUNTIFS($K:$K,$F2,L:L,"<>")),{3,6,8,9})
S8:T9S8=S7-10000
A11:D11A11=INDEX(FILTER($K:$P,($K:$K=$F11)*($L:$L<>""),""),SEQUENCE(COUNTIFS($K:$K,$F11,L:L,"<>")),{2,4,3,1})
S13:T13S13=S9-10000
Dynamic array formulas.
 
Upvote 0
Not sure why you're getting N/A's, this is what I get for the first 2 criteria. The third one returns an error because there is no matching data in the sample.
Note that I had to change the numbers at the end of the formula to match the data source but you should still be seeing a mixture of results and 0 values, not errors.

Book1
ABCDEF
1SupplierRequestorAmountRemaining
2SupplierRequester750001000002001-CONSUMABLES
3SupplierRequester6500090000
4SupplierRequester5500080000
5
6SupplierRequester45000700002002-TOOLS
Sheet1
Cell Formulas
RangeFormula
A2:D4,A6:D6A2=INDEX(FILTER($K:$U,($K:$K=$F2)*($L:$L<>""),""),SEQUENCE(COUNTIFS($K:$K,$F2,L:L,"<>")),{3,4,10,9})
Dynamic array formulas.
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Sequence, the filter, and the Index
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Sequence, the filter, and the Index
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
Hi Guys, apologies for cross-posting without providing the link.
This is the link to where I posted the question.
The formula above was very close to be right but there was #n/a already in the file i provided that were basically confusing the formula when applying to the real file.

Link to the file where I posted the follow-up question on how to fix the formula.
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,417
Members
448,895
Latest member
omarahmed1

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