Removing non-matching values in two columns

samcoarse

Board Regular
Joined
Jun 16, 2016
Messages
63
Hi,

Is there a formula to compare two columns of data and identify and then remove any values that are not present in both columns?

In the attached image example, both columns have each name except for the name DDD and it's corresponding number 4 in column B.

I would like to remove any non-matching names and the corresponding number. The final worksheet would look like the second image with the name DDD and the number 4 removed. Each of the remaining names & corresponding numbers are now on the same row.

Thanks.
 

Attachments

  • Screen Shot 2020-04-22 at 8.26.34 pm.png
    Screen Shot 2020-04-22 at 8.26.34 pm.png
    16.7 KB · Views: 8
  • Screen Shot 2020-04-22 at 8.27.05 pm.png
    Screen Shot 2020-04-22 at 8.27.05 pm.png
    16.7 KB · Views: 7

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
use XL2BB to upload sample data. Pictures cannot be manipulated.
 
Upvote 0
if you are able to use Power Query, you can try
Rich (BB code):
let
    TBL1 = Excel.CurrentWorkbook(){[Name="TableA"]}[Content],
    TBL2 = Excel.CurrentWorkbook(){[Name="TableB"]}[Content],
    Merge = Table.NestedJoin(TBL1,{"Name"},TBL2,{"Name2"},"TBL2",JoinKind.FullOuter),
    Extract = Table.ExpandTableColumn(Merge, "TBL2", {"Name2", "Number"}, {"Name2", "Number.1"}),
    Filter = Table.SelectRows(Extract, each ([Name2] <> null))
in
    Filter
nos.png
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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