Match

lefty78312

Active Member
Joined
Oct 25, 2007
Messages
275
I know I'm missing something easy with this one. I have 2 lists of items. Right now each list is less than 50 items long but they'll both grow. I would like to have a formula that will display only the matching items from both columns in a 3rd column. So if the word 'baseball' appears in both columns, I would like it to start a 3rd column listing 'baseball' (and any other matching words).

Thank you for your assistance.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
if your list is in column A and column B and your new list is C then put this in C1 and copy down

Code:
=IF(ISERROR(MATCH(A1,$B$1:$B$100,0)),"",A1)
 
Upvote 0
I know I'm missing something easy with this one. I have 2 lists of items. Right now each list is less than 50 items long but they'll both grow. I would like to have a formula that will display only the matching items from both columns in a 3rd column. So if the word 'baseball' appears in both columns, I would like it to start a 3rd column listing 'baseball' (and any other matching words).

Thank you for your assistance.
Try this...

Book1
ABCD
1List1List2Matches4
217_10
3108_77
4179_80
52210_84
63014__
75515__
86118__
96223__
106625__
116929__
127746__
138064__
148277__
158380__
168481__
178984__
189086__
199598__
209799__
Sheet1

Enter this formula in D1. This will return the count of items in both lists.

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A20,B2:B20,0))))

Enter this array formula** in D2 and copy down until you get blanks. This will list the common items.

=IF(ROWS(D$2:D2)>D$1,"",INDEX(A:A,SMALL(IF(ISNUMBER(MATCH(A$2:A$20,B$2:B$20,0)),ROW(B$2:B$20)),ROWS(D$2:D2))))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0
Thank you. This is perfect except the items in columns A & B are items, not numbers. Is there any way to get it to match words?
 
Upvote 0
Thank you. This is perfect except the items in columns A & B are items, not numbers. Is there any way to get it to match words?
It'll work with text just as well. I used numbers in the example just because it's easier to generate random numbers for display purposes than it is to generate random text.
 
Upvote 0
Thank you very much; it works perfectly. Two final picayune questions: Is there some way to copy the formula down and have it show blanks instead of #NUM! if there's no match? And what change is necessary to show matches in more than 20 rows?
 
Upvote 0
Thank you very much; it works perfectly. Two final picayune questions: Is there some way to copy the formula down and have it show blanks instead of #NUM! if there's no match? And what change is necessary to show matches in more than 20 rows?
The count formula entered in D1 is used to prevent the #NUM! errors. If you don't want to have a separate cell to get this count then you can add it to the extraction formula but that will make the extraction formula that much longer and less efficient.

I'm not sure what you mean by question 2.

You just need to copy the formula to enough rows that covers the maximum number of matches that are possible. If the lists are 20 rows long and you know that you will never have more than 10 matches then you need to copy the formula to at least 10 rows. You're the only one that knows how many matches may be possible.

If the number of items in the lists expands over time then you can use dynamic named ranges.

http://contextures.com/xlNames01.html#Dynamic
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

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