Only in A, only in B and in both
Comparing two lists sorts every item into one of three groups. In set terms, “only in A” is the difference A minus B, “only in B” is B minus A, and “in both” is the intersection. Together they cover every distinct item in either list, each exactly once.
Example: Who still owes for the field trip
- List A: the 28 students going on the trip
- List B: the 25 names on the payment record
- In both: 24 students who are going and have paid
- Only in A: 4 students who still owe
- Only in B: 1 name that paid but isn't on the trip list
Chase the 4, and check the 1 by hand. It's usually the same student entered two ways, such as Sam Khan and Samuel Khan.
The counts double as a check. Only in A plus in both should equal the number of different items in A. If that comes out lower than the length of list A, the list has repeats, which are counted once.
Everyday jobs for a list comparison
| List A | List B | Column to read |
|---|---|---|
| Invited guests | RSVPs received | Only in A: who hasn't replied |
| Last month's members | This month's members | Only in A: who left. Only in B: who joined |
| Products on the website | Products in the stock count | Only in A: listed but not counted. Only in B: counted but not listed |
| Class roster | Names on handed-in assignments | Only in A: missing work |
| Documents required | Documents received | Only in A: what to chase |
| Volunteers who signed up | Volunteers who showed up | Only in A: no-shows to follow up with |
Mailing lists are another common case. Compare your current newsletter list with the addresses from a sign-up sheet, and “only in B” is exactly who to add. Each result column keeps the order of the list it came from, so if list A was sorted by date or priority, the results are too.
Comparing two spreadsheet columns
Copy one column from each spreadsheet, paste them on either side, and you have the answer without writing a lookup formula. Compare a column of unique IDs, such as customer numbers or email addresses, rather than names, which are far more likely to be typed two ways.
Example: Two exports of customer IDs
- List A: 1,240 IDs from the old system
- List B: 1,198 IDs from the new one
- In both: 1,150. Only in A: 90. Only in B: 48
90 customers didn't make it across in the move, and 48 are new since the export. The counts add up (1,150 + 90 = 1,240), so neither list had repeats.
Whole rows work too. Copy several columns at once and each row arrives as one line with tabs between the cells, so a row only matches when every cell in it is the same.
Why matching items show up as different
Items match once the spaces at each end are trimmed and, unless case sensitivity is on, with capital letters ignored. Everything else has to be identical, and that's where most surprises come from.
- Spaces inside an item. “Khan, Sam” with an extra space after the comma won't match “Khan, Sam”. Clean both lists with Remove Extra Spaces first.
- Different formats. “Sam Khan” and “Khan, Sam”, “St.” and “Street”, or a phone number with and without dashes are different text, even when they mean the same thing.
- Lost leading zeros. Spreadsheets often turn a code like 00427 into the number 427, so one export has the zeros and the other doesn't.
- Invisible characters. Non-breaking spaces from web pages and curly apostrophes (O’Brien against O'Brien) look identical on screen but aren't.
If the same names seem to fill both “only” columns, the lists are in different formats. Fix the format of one list, then compare again.
When to turn on case sensitive matching
Leave it off for names, email addresses and most everyday lists, where Maria and MARIA are the same person. When an item matches with different capitals, the “in both” column shows it the way list A spells it.
Turn it on when capitals carry meaning: product or part codes where AB-12 and ab-12 are different items, file names on systems that treat Report.pdf and report.pdf as two files, or short codes that are case-sensitive by design.
Comparing lists vs comparing documents
This tool treats each list as a set: order doesn't matter and repeats count once. When order matters, or you want to see what changed inside a line, use Compare Text in lines mode instead. And for a prize draw among the people who appear on both lists, paste the “in both” column into the Name Picker.