Compare Two Columns

%3CLINGO-SUB%20id%3D%22lingo-sub-2804605%22%20slang%3D%22en-US%22%3ECompare%20Two%20Columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2804605%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20list%20of%20employees%20who%20submitted%20their%20daily%20reports.%26nbsp%3B%20I%20need%20to%20compare%20this%20list%20with%20the%20complete%20employee%20roster%20to%20determine%20which%20employees%20did%20not%20submit%20their%20daily%20report.%26nbsp%3B%20How%20can%20I%20do%20that%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2804605%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2804690%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20Two%20Columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2804690%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1172735%22%20target%3D%22_blank%22%3E%40pbexpresss%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eyou%20forgot%20to%20mention%20which%20worksheet%20you%20would%20like%20the%20result%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2805395%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20Two%20Columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2805395%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1172735%22%20target%3D%22_blank%22%3E%40pbexpresss%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20depends%20on%20which%20version%20of%20Excel%20you%20are%2C%20how%20your%20data%20is%20organized%20and%20in%20which%20form%20you'd%20like%20to%20see%20the%20result.%3C%2FP%3E%0A%3CP%3EThat%20could%20be%20helper%20COUNTIF()%20column%20with%20filtering%20on%20it%2C%20could%20be%20dynamic%20arrays%20formulae%2C%20could%20be%20conditional%20formatting%2C%20could%20be%20Power%20Query%2C%20whatever.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2805682%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20Two%20Columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2805682%22%20slang%3D%22en-US%22%3EOkay.%20Here%20are%20the%20details.%20Each%20day%20my%20employees%20submit%20a%20daily%20report%20to%20the%20cloud.%20A%20summary%20report%20is%20run%20automatically%20and%20emailed%20to%20me%20by%20the%20software%20company.%20I%20need%20to%20create%20a%20list%20at%20the%20bottom%20of%20the%20report%20of%20names%20of%20employees%20who%20did%20not%20submit%20a%20report.%20I%20was%20trying%20to%20compare%20this%20report%20with%20a%20master%20file%20of%20names.%20How%20should%20I%20do%20this%3F%3C%2FLINGO-BODY%3E
New Contributor

I have a list of employees who submitted their daily reports.  I need to compare this list with the complete employee roster to determine which employees did not submit their daily report.  How can I do that?

7 Replies

@pbexpresss 

 

you forgot to mention which worksheet you would like the result

@pbexpresss 

It depends on which version of Excel you are, how your data is organized and in which form you'd like to see the result.

That could be helper COUNTIF() column with filtering on it, could be dynamic arrays formulae, could be conditional formatting, could be Power Query, whatever.

Okay. Here are the details. Each day my employees submit a daily report to the cloud. A summary report is run automatically and emailed to me by the software company. I need to create a list at the bottom of the report of names of employees who did not submit a report. I was trying to compare this report with a master file of names. How should I do this?

@pbexpresss 

Thank you, but still better to have sample file.

If these are two different file you may use Power Query to compare data an return the table with records which don't meet condition.

I will give Power Query a try.

Thanks

@pbexpresss Hi. Assuming Excel 365, this is a way

XMATCH looks for all names among those reported.

ISERROR becomes true if they are not in the list of reported hours

FILTER shows all names that have not reported

 

=FILTER(G2:G6;ISERROR(XMATCH(G2:G6;A2:A4)))

 

bosinander_0-1633237669839.png

 

Change G2:G6 to range in your workbook with all names.

 

Using the function LET makes it easier to read and test the different parts.

Last line is what the cell outputs and changing "output" to eg haveReport shows that part of the calculation.

I prefer to have the definitions indented.

 

=LET(allNames;G2:G6;
         reportedNames;A2:A4;
haveReported;XMATCH(allNames;reportedNames);
haveNotReported;ISERROR(haveReported);
output;FILTER(allNames;haveNotReported);
output
)

@bosinander The combination of functions worked perfectly.  I created a file that maintains my master employee list.  When I retrieve the file summarizing my employees' daily report submissions, the macro I created uses your suggestions to compare the list from one file with the other file. Then it gives me a list of employees who did not work that day at the bottom of the daily report submission report.

 

Thanks,