Compare Two Lists

AllisterB

Board Regular
Joined
Feb 22, 2019
Messages
120
Office Version
  1. 365
Platform
  1. Windows
I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the web.
I need to be able to know for each Person (First name +las tname) at a Branch, the differences in the Role and Date Appointed between the two Lists.
It is possible for a Branch that the Person is on one List but not on the other.
[Once the differences are identified the user will check what is the correct Information and make changes to the lists to get them to match]

I have tried using PQ Merge but couldn't get this to work.

Has anyone got any ideas

Thanks

Allister

Book2
EFGHIJKLMNOPQ
4List 100List 200
5BranchRoleAppomitedFirst NameLast NameBranchJobFirst NameLast NameAppomited
6AWorker1/03/2020MickeyMouseAWorkerMickeyMouse1/03/2020
7BManager3/06/2019DonaldDuckAManagerGoofyBrown14/03/2018
8AManager14/03/2018GoofyBrownAWorkerJasminOrange18/03/2012
9AWorker1/06/2007JasminOrangeBWorkerHarryHall1/04/2017
10BWorker30/08/2011PopeySailorCManagerJonnyAppleseed31/03/1945
11BWorker1/04/2017HarryHallDWorkerSallyTrout30/12/2018
12CManager31/03/1945JonnyAppleseed
13CWorker11/11/2011DaffyTailor
14
List 2
 
Creat Two tables: List100 and List200

1600655692667.png

1600655705580.png


Merge Queries as New:

1600655747572.png


the M code:
Rich (BB code):
let
    Columns={"Branch", "First Name", "Last Name"},
    Source = List100&
                     Table.NestedJoin(
                                      List200, Columns,
                                      List100, Columns,
                                      "List100",
                                      JoinKind.LeftAnti
                                      )[[Branch],[First Name],[Last Name]],
    res = Table.ExpandTableColumn(
                                  Table.NestedJoin(
                                                   Source,Columns,
                                                   List200,Columns,
                                                   "n", JoinKind.LeftOuter
                                                  ),
                                  "n",
                                  {"Job", "Appomited"},
                                  {"Job", "Appomited.200"}
                                 )
in
    res
1600655910482.png

final result as below:


Book1.xlsx
ABCDEFG
13BranchRoleAppomitedFirst NameLast NameJobAppomited.200
14AWorker2020/3/1MickeyMouseWorker2020/3/1
15BManager2019/6/3DonaldDuck
16AManager2018/3/14GoofyBrownManager2018/3/14
17AWorker2007/6/1JasminOrangeWorker2012/3/18
18BWorker2017/4/1HarryHallWorker2017/4/1
19BWorker2011/8/30PopeySailor
20CManager1945/3/31JonnyAppleseedManager1945/3/31
21CWorker2011/11/11DaffyTailor
22DSallyTroutWorker2018/12/30
Sheet5
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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