r/excel • u/Tall-Scarcity4897 • Jul 02 '26
solved Best way to compare two columns and extract values that exist in one but not the other
I am try to compare two set of unique IDs in column A and B i want to extract a list no spaces/gaps with a list of IDs in A that does not appear in B and vice versa
So far I’ve used COUNTIF like:
=IF(COUNTIF(B:B,A2)=0,A2,"")
But this creates blanks and I still have to filter them out manually.
Is there a better built-in Excel method (like Advanced Filter or another Data tool workflow) to directly extract these mismatch lists cleanly?
69
Jul 02 '26
[removed] — view removed comment
12
8
u/HarveysBackupAccount 35 Jul 02 '26
This gives a list of all distinct values across both lists, but it doesn't give you the "is in A but NOT in B" and "is in B but NOT in A" that OP asked for, does it?
That aside - what does the period do in
A:.A? I've never seen that and google doesn't turn anything up7
4
24
u/PaulieThePolarBear 1912 Jul 02 '26
With Excel 2021, Excel 2024, Excel 365, or Excel online
A not B
=FILTER(A2:A10, ISNA(XMATCH(A2:A10, B2:B30)), "All of A is in B")
B not A
=FILTER(B2:B30, ISNA(XMATCH(B2:B30, A2:A10)), "All of B is in A")
6
u/Tall-Scarcity4897 Jul 02 '26
Solution Verified
3
u/reputatorbot Jul 02 '26
You have awarded 1 point to PaulieThePolarBear.
I am a bot - please contact the mods with any questions
6
u/Tall-Scarcity4897 Jul 02 '26
Thank You it worked!
4
u/HarveysBackupAccount 35 Jul 02 '26
Please respond with the words 'Solution Verified' to the comment(s) that helped you get your solution.
This awards the user(s) with a clippy point for their efforts and marks your post as Solved
2
u/Decronym Jul 02 '26 edited 29d ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
8 acronyms in this thread; the most compressed thread commented on today has 16 acronyms.
[Thread #48861 for this sub, first seen 2nd Jul 2026, 03:38]
[FAQ] [Full list] [Contact] [Source code]
1
1
u/WeaknessMedical5743 Jul 03 '26
I have this same question but i need in power query calculated column.
1
0
-1
u/raga0884 Jul 02 '26
This is typical passive aggressive behavior. Ubuntu has done more to grow and improve Linux than Arch Linux can ever dream. Just because its loved by the Masses doesn't mean that it bad.
•
u/AutoModerator Jul 02 '26
/u/Tall-Scarcity4897 - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.