Index and Match

%3CLINGO-SUB%20id%3D%22lingo-sub-1959809%22%20slang%3D%22en-US%22%3EIndex%20and%20Match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1959809%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20there%2C%3C%2FP%3E%3CP%3EI%20have%20a%20large%20file%20of%20data%20and%20I%20have%20a%20set%20of%20random%20values%20from%20a%20different%20excel%20workbook%20that%20I%20am%20trying%20to%20match%20to%20my%20large%20file.%20For%20example%2C%20lets%20say%20I%20have%20four%20columns%20A%2CB%2C%20C%2C%20%26amp%3B%20D%20in%20my%20large%20file.%20I%20am%20trying%20to%20match%20the%20random%20values%20I%20have%20from%20the%20other%20excel%20workbook%20to%20column%20B%2C%20If%20an%20exact%20match%20was%20found%2C%20I%20want%20to%20return%20the%20values%20from%20columns%20A%20and%20D%20along%20with%20column%20B.%20However%2C%20I%20am%20having%20trouble%20with%20writing%20this%20formula.%20so%20the%20new%20formatting%20would%20return%20in%20a%20table%20and%20look%20like%20column%20B%20first%20then%20Column%20A%2C%20then%20Column%20D%20in%20a%20table.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1959809%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1959860%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20and%20Match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1959860%22%20slang%3D%22en-US%22%3EPlease%20edit%20your%20post%20and%20share%20some%20sample%20data%20with%20us%2C%2C%20and%20what%20you%20are%20trying%20to%20match%20the%20value%2C%2C%2C%20along%20with%20the%20formula%20you%20have%20tried%20so%20far!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1960632%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20and%20Match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1960632%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20for%20the%20replies.%20Please%20see%20the%20attached%20screenshot%20for%20reference.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1960646%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20and%20Match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1960646%22%20slang%3D%22en-US%22%3EI%20am%20having%20trouble%20with%20showing%20the%20balance%20column%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1961591%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20and%20Match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1961591%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F892362%22%20target%3D%22_blank%22%3E%40waseem385%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EYou%20need%20to%20write%20this%20formula%20in%20cell%20C2%3A%3C%2FLI%3E%3C%2FUL%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DINDEX(%5BWorkbook.xls%5DSheet1!%24F%242%3A%24F%2410%2CMATCH(A2%2C%5BWorkbook.xls%5DSheet1!%24b%242%3A%24b%2410%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EYou%20get%20related%20data%20in%20column%20C%20.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EYou%20need%20to%20adjust%20cell%20references%20in%20the%20formula%20as%20needed.%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1965808%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20and%20Match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1965808%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENo%20this%20returns%20match%20value%20from%20one%20column%20only%2C%20since%20Index%20is%20on%20Column%20F.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DINDEX(%5BWorkbook.xls%5DSheet1!%24F%242%3A%24F%2410%2CMATCH(A2%2C%5BWorkbook.xls%5DSheet1!%24b%242%3A%24b%2410%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3ETo%20get%20values%20from%20multiple%20columns%20this%20needs%20to%20modified%3A%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DINDEX(%5BWorkbook.xls%5DSheet1!%24A%242%3A%24F%2410%2CMATCH(A2%2C%5BWorkbook.xls%5DSheet1!%24b%242%3A%24b%2410%2C0)%2C%7B1%2C2%2C4%7D)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20multiple%20Rows%20an%20Array%20(CSE)%20formula%20is%20required%20with%20SMALL%20function.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%7B%3DINDEX(%24A%241%3A%24D%2425%2C%20SMALL(IF(COUNTIF(%24G%241%2C%20%24B%241%3A%24B%2425)%2C%20ROW(%24A%241%3A%24D%2425)-MIN(ROW(%24A%241%3A%24D%2425))%2B1)%2C%20ROW(A1))%2C%20COLUMN(A1))%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EFinish%20formula%20with%20Ctrl%2BShift%2BEnter%20and%20fill%20across.%3C%2FLI%3E%3CLI%3EAdjust%20cell%20references%20in%20formula%20as%20needed.%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1970186%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20and%20Match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1970186%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConsidering%20the%20last%20post%20my%201st%20formula%20returns%20value%20form%20column%20F%20only.%20The%20second%20one%20returns%20from%20column%20A%2C%26nbsp%3B%20%3CSPAN%3E%3CFONT%20size%3D%222%22%3EB%2C%3C%2FFONT%3E%26nbsp%3B%3C%2FSPAN%3Eand%20D%20only%2C%2C%26nbsp%3B%20the%20last%20one%20returns%20multiple%20records%20if%20match%20with%20the%20criteria%2C%20and%20all%20are%20working%20!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Deleted
Not applicable

Hello there,

I have a large file of data and I have a set of random values from a different excel workbook that I am trying to match to my large file. For example, lets say I have four columns A,B, C, & D in my large file. I am trying to match the random values I have from the other excel workbook to column B, If an exact match was found, I want to return the values from columns A and D along with column B. However, I am having trouble with writing this formula. so the new formatting would return in a table and look like column B first then Column A, then Column D in a table.

 

Thank you,

14 Replies
Please edit your post and share some sample data with us,, and what you are trying to match the value,,, along with the formula you have tried so far!

@Deleted 

Perhaps you mean something like

=INDEX(A:D,MATCH(value,B:B,0),{1,2,4})

Thank you for the replies. Please see the attached screenshot for reference. 

I am having trouble with showing the balance column

@Deleted 

In theory it shall work, at least on Excel with dynamic arrays.

@Deleted 

 

  • You need to write this formula in cell C2:

 

 

=INDEX([Workbook.xls]Sheet1!$F$2:$F$10,MATCH(A2,[Workbook.xls]Sheet1!$b$2:$b$10,0))

 

 

You get related data in column C .

 

Note: 

  • Your formula is not working because you have used invalid data range with, MATCH(A2:A10, it should like MATCH(A2
  • You need to adjust cell references in the formula as needed.

@Rajesh-S 

That returns only one row and all columns. Initial formula returns all rows and two columns at once.

@Sergei Baklan 

 

No this returns match value from one column only, since Index is on Column F.

 

 

=INDEX([Workbook.xls]Sheet1!$F$2:$F$10,MATCH(A2,[Workbook.xls]Sheet1!$b$2:$b$10,0))

 

To get values from multiple columns this needs to modified:

 

 

=INDEX([Workbook.xls]Sheet1!$A$2:$F$10,MATCH(A2,[Workbook.xls]Sheet1!$b$2:$b$10,0),{1,2,4})

 

 

For multiple Rows an Array (CSE) formula is required with SMALL function.

 

 

{=INDEX($A$1:$D$25, SMALL(IF(COUNTIF($G$1, $B$1:$B$25), ROW($A$1:$D$25)-MIN(ROW($A$1:$D$25))+1), ROW(A1)), COLUMN(A1))}

 

 

  • Finish formula with Ctrl+Shift+Enter and fill across.
  • Adjust cell references in formula as needed.

@Rajesh-S 

That's what in initial formula, it returns columns {1,6} and it's not clear why second one doesn't work. Multiple rows in initial formula are for dynamic array case as MATCH(range1, reange2, 0), but in this case that's most probably doesn't matter. 

@Sergei Baklan 

 

Considering the last post my 1st formula returns value form column F only. The second one returns from column A,  B, and D only,,  the last one returns multiple records if match with the criteria, and all are working !

@Rajesh-S 

I have no doubt it works in your case, the question is why it doesn't work for @Deleted 

@Sergei Baklan 

 

Check the Note part of my first post, I've shown the reason why OP's formula is not working!

@Rajesh-S 

MATCH(A2:A10,.. shall work. On Excel with dynamic arrays it returns an array, on old Excel implicit intersection shall be silently switched on and single value will be taken. 

 

Neither the OP nor I've suggested an array formula, being solution provider sometimes need to consider OP understanding !!