Index Match to return matched values from a list

Spurredon

New Member
Joined
Sep 4, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I have a list below and want to return all matching results in column B into column D. Also, I wanted to copy down the formula in column E to return all the results against every name that matches. The length of the lists do not match and there is a blank column but this does not matter as it a real life scenario I am trying to replicate. I have tried INDEX and INDEX MATCH combinations but all the examples only look for one return value. Any help is appreciated to use the correct formula in cell E2 to then copy down for all names and results to match. Many thanks (y)
ABCDE
1NameResultNameResult
2JohnPassDavinder
3MarkFailMary
4DavinderFailHelen
5OlaPassOla
6TomPassTom
7HelenPassMark
8John
9Luke
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi & welcome to MrExcel.
How about
+Fluff New.xlsm
ABCDE
1NameResultNameResult
2JohnPassDavinderFail
3MarkFailMary 
4DavinderFailHelenPass
5OlaPassOlaPass
6TomPassTomPass
7HelenPassMarkFail
8JohnPass
9Luke 
Data
Cell Formulas
RangeFormula
E2:E9E2=XLOOKUP(D2,$A$2:$A$7,$B$2:$B$7,"",0)
 
Upvote 0
Great thanks so much it works! Never tried the new XLOOKUP only VLOOKUP. The other good thing is that the XLOOKUP copes with inserting and deleting new columns as well as looking left to right which are limitations with VLOOKUP according to what I have just read. I take it then that this kind of task cannot be done easily with INDEX and MATCH and I was barking up the wrong tree. I feel like I have a new power tool for going forward! (y)
 

Attachments

  • 1599236168122.png
    1599236168122.png
    17.5 KB · Views: 2
Upvote 0
I used Index/Match and it seems to work

Book12
ABCDE
1NameResultNameResult
2JohnPassDavinderFail
3MarkFailMary#N/A
4DavinderFailHelenPass
5OlaPassOlaPass
6TomPassTomPass
7HelenPassMarkFail
8JohnPass
9Luke#N/A
Sheet1
Cell Formulas
RangeFormula
E2:E9E2=INDEX($B$2:$B$7,MATCH(D2,$A$2:$A$7,0))
 
Upvote 0
As Alan has shown, it can easily be done with index/match, it can also be done with Vlookup
+Fluff New.xlsm
ABCDEF
1NameResultNameResultVlookup
2JohnPassDavinderFailFail
3MarkFailMary #N/A
4DavinderFailHelenPassPass
5OlaPassOlaPassPass
6TomPassTomPassPass
7HelenPassMarkFailFail
8JohnPassPass
9Luke #N/A
Data
Cell Formulas
RangeFormula
E2:E9E2=XLOOKUP(D2,$A$2:$A$7,$B$2:$B$7,"",0)
F2:F9F2=VLOOKUP(D2,$A$2:$B$7,2,0)


One of the advantages of the new xlookup, is that it has an in-built error handler if no match is found.
 
Upvote 0
Thanks for the INDEX MATCH option it's good to know. I know I can use VLOOKUP but prefer the XLOOKUP now I've tried it due to the error handling and other advantages over VLOOKUP. Appreciate the different options offered and all very useful for my Excel toolbox (y)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
An alternative option is to use Power Query and join the two tables in a Query. If this interests you, post back and I will demonstrate.
 
Upvote 0
An alternative option is to use Power Query and join the two tables in a Query. If this interests you, post back and I will demonstrate.
I am working on something similar. Here is my Issue.
Sheet1 (with four Columns )
ItemNumber | Name | QtyOnHand | Actualcount

Sheet2 (With two columns)
ItemNumber | Qty

I am using this formula "=INDEX(Sheet2!$B$2:$B$7,MATCH(A2,$A$2:$A$7,0))" to match the ItemNumber on any cell in both of the Sheets and get the value fro Sheet2 ""Oty" into Sheet1 Actualcount
Some how it has become a difficulty for me to make it work.
if possible I like to INDEX/MATCH, Power Query work
thank you
John
 
Upvote 0
@parsec
Please start a thread of your own for this question. Thanks
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,836
Members
449,096
Latest member
Erald

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