asorenson
asorenson

Reputation: 169

How to create new table from existing table, where column A in another column

I have a dataset of orders, and a second list of order ID's for which there were problems. I would like to create a new table consisting of all of the values from the original set, where Column A (Order ID) is in Sheet 2 Column A (Order ID).

I've tried various things with Pivot Tables, Conditional Formatting, VLOOKUP and XMATCH, but have not been able to get it to work. I'm tempted to dump it into a database so that I can just run the super simple SQL query ("SELECT * FROM Table1 WHERE column1 IN (SELECT column1 FROM Table2)") to get this, but I'd like to know how to accomplish this in Excel.

Upvotes: 0

Views: 51

Answers (1)

Black cat
Black cat

Reputation: 6271

pls. try this formula in cell I1 and drag down

=CHOOSEROWS($A$1:$E$19,TOROW(IF(H1=$A$1:$A$19,ROW($A$1:$A$19),1/0),2))

Column H is the column of the list of the values to search
Column A:E are the data range
Column I is the result column enter image description here

Upvotes: 1

Related Questions