I have a large file with numerous VLOOKUP functions that I would like to change to INDEX/MATCH for efficiency. To do so, the INDEX/MATCH equation apparently must ignore blank rows in the data. Can this be done?
Here is my initial attempt which only works on the first item (row 4 (HRL)) but will not work on row 43 (UTX), apparently because of the intervening blank rows.
Formula in J4 - {=INDEX('Stock Input'!$X$4:$AA56,,4,MATCH(Alerts!B4,Alerts!$B$4:$B$56))}
Link to Spreadsheet in Dropbox https://www.dropbox.com/s/i7fhvvs7nntrtt8/INDEX MATCH TEST v1.xlsm?dl=0
SHEETNAME "ALERTS"
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]J[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4[/TD]
[TD]HRL[/TD]
[TD]{=INDEX('Stock Input'!$X$4:$AA56,,4,MATCH(Alerts!B4,Alerts!$B$4:$B$56))}[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]43[/TD]
[TD]UTX[/TD]
[TD]???[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]56[/TD]
[TD]CNMX[/TD]
[TD]???[/TD]
[/TR]
</tbody>[/TABLE]
SHEETNAME "STOCK INPUT"
[TABLE="class: outer_border, width: 300"]
<tbody>[TR]
[TD]COL
#[/TD]
[TD]X[/TD]
[TD]Y[/TD]
[TD]Z[/TD]
[TD]AA[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4[/TD]
[TD]HRL[/TD]
[TD]HORMEL[/TD]
[TD]29.35[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[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/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Can anyone help with a solution? Thanks in advance.
Here is my initial attempt which only works on the first item (row 4 (HRL)) but will not work on row 43 (UTX), apparently because of the intervening blank rows.
Formula in J4 - {=INDEX('Stock Input'!$X$4:$AA56,,4,MATCH(Alerts!B4,Alerts!$B$4:$B$56))}
Link to Spreadsheet in Dropbox https://www.dropbox.com/s/i7fhvvs7nntrtt8/INDEX MATCH TEST v1.xlsm?dl=0
SHEETNAME "ALERTS"
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]J[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4[/TD]
[TD]HRL[/TD]
[TD]{=INDEX('Stock Input'!$X$4:$AA56,,4,MATCH(Alerts!B4,Alerts!$B$4:$B$56))}[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]43[/TD]
[TD]UTX[/TD]
[TD]???[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]56[/TD]
[TD]CNMX[/TD]
[TD]???[/TD]
[/TR]
</tbody>[/TABLE]
SHEETNAME "STOCK INPUT"
[TABLE="class: outer_border, width: 300"]
<tbody>[TR]
[TD]COL
#[/TD]
[TD]X[/TD]
[TD]Y[/TD]
[TD]Z[/TD]
[TD]AA[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4[/TD]
[TD]HRL[/TD]
[TD]HORMEL[/TD]
[TD]29.35[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[T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][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Can anyone help with a solution? Thanks in advance.