Get the missing data

SandsB

Well-known Member
Joined
Feb 13, 2007
Messages
705
Office Version
  1. 365
Platform
  1. Windows
There's always some VBA I'm not smart enough to do.
So I have 2 lists each with the name of a record owner in column A. List1 is all the records I already know belong to Bob. The number of rows varies each day. I want to get the contents of each row in List2 (# of rows also varies) that shows Bob in column A if that record number isn't already in List1 and I need those additional rows to be placed under whatever is the bottom row in today's version of List1. In the example below, I have 4 records for Bob in List1 so I need to add the rows for Bob Record8 and Bob Record11 starting in row 5 of List1. I don't need to edit List2 at all and I'm not concerned with anyone other than Bob.

List1
Bob Record1
Bob Record2
Bob Record5
Bob Record7


List2
Bob Record1
Bob Record2
Joe Record3
Bob Record5
Mary Record6
Bob Record7
Bob Record8
Ed Record9
Mary Record10
Bob Record 11
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
With Power Query
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Source2 = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    Merge = Table.NestedJoin(Source, {"List1","Column1"}, Source2, {"List2","Column1"}, "Table2", JoinKind.FullOuter),
    ExpandTable = Table.ExpandTableColumn(Merge, "Table2", {"List2", "Column1"}, {"List2", "Column1.1"}),
    FilterRows = Table.SelectRows(ExpandTable, each ([List2] = "Bob")),
    RemoveColumns = Table.SelectColumns(FilterRows,{"List2", "Column1.1"})
in
    RemoveColumns
Book4
ABCDE
1List1Column1List2Column1.1
2BobRecord1BobRecord1
3BobRecord2BobRecord2
4BobRecord5BobRecord5
5BobRecord7BobRecord7
6BobRecord8
7BobRecord11
8List2Column1
9BobRecord1
10BobRecord2
11JoeRecord3
12BobRecord5
13MaryRecord6
14BobRecord7
15BobRecord8
16EdRecord9
17MaryRecord10
18BobRecord11
Sheet1
 
Upvote 0
Thanks, Power Query looks interesting and I'll play with it later. This doesn't quite do what I'm looking for, though.
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,234
Members
449,092
Latest member
SCleaveland

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