INDEX/MATCH returning value on row BEFORE the right one

megera716

Board Regular
Joined
Jan 3, 2013
Messages
140
Office Version
  1. 365
Platform
  1. Windows
I need to do a lookup on multiple criteria. I put this formula together and was happy to see it worked but just discovered it's returning the incorrect value.

Here is my formula -- and yes, I am doing Ctrl+Shift+Enter to do this as an array.
INDEX(Table3[[#All],[Name]:[AccessID]],MATCH(1,([@[Toolbox Name]]=Table3[Name])*([@[TB Org Name]]=Table3[ProviderName]),0),17)

Table3 is huge -- 200,000 row by 17 columns (beginning with Name, ending with Access ID).

Then I have my own table that's 1,600 rows by 15 columns that I'm trying to look up info on the people in there in Table3.
Toolbox NameToolbox Org NameID #
David Jones
John Smith
Smith Hospital
Main Street Hospital
John SmithState Street Hospital

<colgroup><col span="2"><col></colgroup><tbody>
</tbody>

John Smith is located in Table3, and has his own unique ID in there that ties him and his org together, but I need to get that into my new table based on both Name AND Org Name criteria. When I use the above formula, it returns the row ABOVE the matching one, even though none of that info is the same.

For example, if I'm trying to look up John Smith, it returns the ID # on David Jones row even though neither the name nor the org name matches.

Sorry if this is confusing. I'll be happy to clarify as needed!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
It appears that the first referenced range in your INDEX function refers to the entire table column (including the heading), but the MATCH function refers to only the data body range. Consequently, the incorrrect value would be returned.

Try changing
this: INDEX(Table3[[#All],[Name]:[AccessID]],
to this: INDEX(Table3[[Name]:[AccessID]],

Does that help?
 
Upvote 0
It appears that the first referenced range in your INDEX function refers to the entire table column (including the heading), but the MATCH function refers to only the data body range. Consequently, the incorrrect value would be returned.

Try changing
this: INDEX(Table3[[#All],[Name]:[AccessID]],
to this: INDEX(Table3[[Name]:[AccessID]],

Does that help?

YES!

THANK YOU, THANK YOU! Such a simple fix, but I couldn't have figured it out! Can I give you internet points or hugs or my undying gratitude (you can imagine that with 200K rows, this is hardly the project for manual entry)?
(y)
 
Upvote 0

Forum statistics

Threads
1,216,745
Messages
6,132,473
Members
449,729
Latest member
davelevnt

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