My index match formula is setup to pull an exact match(setup as 0). Why would my end results change based on sorting or anything else? Is there something Im missing about index/match?
1]
=VLOOKUP(A2,$E$2:$G$400,3,0)
2]
=INDEX($G$2:$G$400,MATCH(A2,$E$2:$E$400,0))
[1] and [2] are identical in retieval behavior.
If $E$2:$G$400 is sorted in ascending order on E2:E400, the following is also identical in behavior to [1] and [2]...
3]
=IF(LOOKUP(A2,$E$2:$E$400)=A2,LOOKUP(A2,$E$2:$E$400,$G$2:$G$400),"")
Qua performance:
[3] is the fastest, [2] is somewhat better than [1].
All of the preceding formulas do exact matching.
_____________________________________________
Consider the table in A2:B5, which is sorted on A2:A5 in ascending order...
<TABLE style="WIDTH: 96pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=128><COLGROUP><COL style="WIDTH: 48pt" span=2 width=64><TBODY><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; WIDTH: 48pt; HEIGHT: 14.4pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 height=19 width=64 align=right>
0</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 width=64>
FAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 height=19 align=right>
40</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63>
KAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 height=19 align=right>
85</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63>
LAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 height=19 align=right>
97</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63>
KAD</TD></TR></TBODY></TABLE>
4]
=VLOOKUP(F2,$A$2:$B$5,2,1)
5]
=INDEX($B$2:$B$5,MATCH(F2,$A$2:$A$5,1))
6]
=LOOKUP(F2,$A$2:$A$5,$B$2:$B$5)
[4] to [6] do all approximate matching and all are very fast.
_____________________________________________
7]
=LOOKUP(9.99999999999999E+307,{0,#N/A})
=VLOOKUP(9.99999999999999E+307,{0;#N/A},1,1)
=INDEX({0,#N/A},MATCH(9.99999999999999E+307,{0,#N/A},1))
8]
=LOOKUP(9.99999999999999E+307,N2:N100)
=VLOOKUP(9.99999999999999E+307,N2:N100,1,1)
=INDEX(N2:N100,MATCH(9.99999999999999E+307,N2:N100,1))
9]
=LOOKUP(9.99999999999999E+307,N:N)
=VLOOKUP(9.99999999999999E+307,N:N,1,1)
=INDEX(N:N,MATCH(9.99999999999999E+307,N:N,1))
10]
=LOOKUP(9.99999999999999E+307,4:4)
=VLOOKUP(9.99999999999999E+307,4:4,1,1)
=INDEX(4:4,MATCH(9.99999999999999E+307,4:4,1))
All of [7] to [10] picks out the last numeric value from the reference they are given. And they do so very fast.
If you replace 9.99999999999999E+307 with REPT("z",255), these formulas will pick out the last text value from the reference they are given. And they will do so very fast.
Hope this helps you sort out matters retrieval...