Comparing Tables w/ Pivot Table?

mrsbrannon

Board Regular
Joined
Mar 7, 2018
Messages
61
Hello all,

I have two tables of data that is the "same" but being pulled from two difference sources. I need a way to combine this data and check for differences. The data is currently all in one workbook (but different sheets) and I would like to keep it that way. One set of data is manually entered and the other is exported from a report. Below is an example of the two sheets. The column headers do not match as the report headers are automated. If I HAVE to change the manual data (headers) to reflect the automated report, I can, but prefer not to.

Employee NameHours Worked
Smith, John5
Brown, James10

<tbody>
</tbody>
Sheet 1

User NameHours Entered
Smith, John5
Brown, James11

<tbody>
</tbody>
Sheet 2

Employee NameHours Worked Hours Entered
Smith, John55
Brown, James1011

<tbody>
</tbody>
Desired Result

I feel like the answer is fairly simple, but I cannot put my finger on it. I've tried doing pivot tables with multiple consolidated data ranges, but that doesn't produce what I'm looking for. Any assistance is greatly appreciated.

Thanks.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
try PowerQuery

Employee NameHours WorkedUser NameHours EnteredEmployee NameHWHE
Smith, John
5​
Smith, John
5​
Smith, John55
Brown, James
10​
Brown, James
11​
Brown, James1011

Code:
[SIZE=1]let
    Source = Table.Combine({Table10, Table11}),
    #"Grouped Rows" = Table.Group(Source, {"Employee Name"}, {{"Count", each _, type table}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "HW", each Table.Column([Count],"Hours Worked")),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"HW", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    #"Added Custom1" = Table.AddColumn(#"Extracted Values", "HE", each Table.Column([Count],"Hours Entered")),
    #"Extracted Values1" = Table.TransformColumns(#"Added Custom1", {"HE", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    #"Removed Columns" = Table.RemoveColumns(#"Extracted Values1",{"Count"})
in
    #"Removed Columns"[/SIZE]

btw. in this case you need to change User Name to Employee Name. You can do that in source table or in PQ Editor
 
Last edited:
Upvote 0
or with PivotTable (Alt+D+P)

Employee NameHours WorkedUser NameHours EnteredSum of ValueColumn
Smith, John
5​
Smith, John
5​
RowHours EnteredHours Worked
Brown, James
10​
Brown, James
11​
Brown, James
11​
10​
Smith, John
5​
5​
 
Upvote 0

Forum statistics

Threads
1,214,790
Messages
6,121,608
Members
449,038
Latest member
apwr

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