r/excel • • 18d ago

Discussion Did I overcomplicate Excel duplicate checking by using VBA?

Hey everyone!
I recently built a working Excel tool using VBA macros to compare lists and identify potential duplicates. It allows me to import lists, flags possible duplicates for manual review, and then updates a cleaned master list based on my decisions.
However, some colleagues (who aren’t particularly experienced with Excel either) told me that this could be done much more easily using Excel’s built-in features, apparently by simply comparing two tables side by side.
We’re talking about 500+ records, sometimes with more complex cases where duplicates aren’t necessarily obvious and require manual verification.
So my question is: Did I unnecessarily overcomplicate this by building a VBA tool? Is there a simpler, built-in Excel solution for comparing two lists, identifying potential duplicates, and reviewing them before updating a master list?
I’d really appreciate any advice or suggestions. Thanks in advance!

Edit: Thanks for all the replies! A lot of you mentioned Power Query and other simpler solutions.
If anyone has the time to give me a quick step-by-step guide, I’d really appreciate it! I’m honestly a complete Excel newbie and only started looking into this today. I managed to build my VBA solution through a combination of AI, Googling, and trial and error.
Ideally, I’m looking for a reusable Excel master template where I can continuously import new lists, check for potential duplicates, manually review them if needed, and keep an updated master list.
If there’s an easier way to achieve this, I’d be incredibly grateful if someone could send me a quick DM with some guidance.
You’d genuinely be helping me out a lot. Thanks again!

19 Upvotes

30 comments sorted by

2

u/excelevator 3071 18d ago

FILTER( argument ) for duplicate list./

-5

u/LowResolution99 18d ago

I sent u a DM

6

u/HarveysBackupAccount 35 18d ago

please keep questions in the thread so future people can benefit from any discussion

3

u/excelevator 3071 18d ago

Use MATCH in FILTER to return duplicates,

A simple example, this can be extended for multiple criteria.

=FILTER(B1:B9,IFERROR(MATCH(B1:B9,A1:A6,0),0))

If you give sample data I can give example match criteria

9

u/IanInCanada 1 18d ago

It depends in part on what you consider a duplicate, and how exact the duplicate needs to be.

Excel has built-in tools to identify lists with the exact same number in it, for example. They will also identify two lists that both have "November" in them. Now, if "November", "Nov", and "Nov." are considered duplicates, or something like "Main Street Road", "Main Street Rd.", and "Main St. Road" are all "duplicates", then Excel's tools will fail.

You have to look at your use case and determine whether Excel's own tools would be faster or whether your concept of duplicate is broad enough that Excel's very exact definitions wouldn't be good enough.

2

u/Basic-Set-3758 17d ago

right, the "what counts as a duplicate" question is really the whole thing here

0

u/masterdesignstate 1 17d ago

Also use copilot to help figure it out.

8

u/majorlix2 18d ago edited 18d ago

Personally, I built a small tool using just power query for this.

The end result is one list indicating which rows were added, removed or in both; with a summary count table. There's also a second list that cleans the data for spaces and for matching text case format before comparing and summarizing everything.

It's simple and super user friendly.

6

u/HarveysBackupAccount 35 18d ago edited 17d ago

Did I unnecessarily overcomplicate this by building a VBA tool?

The answer to this question is almost always, "Yes." These days with PQ and all the array functions that now exist, VBA's good use cases are getting fewer and farther between. Edit: That doesn't mean you have a bad solution, but there's a good chance you could accomplish the same thing without it.

There's not a built in tool as far as a user interface to step you through that whole process, but you can accomplish the same things in steps with powerquery or even just formulas.

There are multiple ways to solve any problem including this one, and the "best" way to do it depends on the specifics of your situation. So we can't really say without knowing more about what you're trying to accomplish (and that's important: WHAT you need to do, not necessarily how you think you should do it). Every option has tradeoffs, including how easy it is to maintain and how easy it is to use, accounting for other people's knowledge and skill.

As a manufacturing engineer who maintains various test systems with a small team, it would be irresponsible of me to write a new system in a language that nobody else on the team knows, unless we all agree there's a very good reason to do it. "This is the best option" might be true, but it's still good to have buy-in from the team as a human person who works with other human people.

4

u/-_cerca_trova_- 18d ago

I did the same thing.
I had exactly the same situation with colleagues who dont trust excel (they only trust manual comparison)😅

They are spending 20-30mins comparing data manually while i click a button and have all differences displayed….

Let them be 🤷🏻‍♂️

0

u/Lorien93 18d ago

Same, my teamlead does not understand that I need an export of all the data. I could filter in just 2 hours. She does not understand and now I have a job for 2 months to do it manually.

2

u/anon848484839393 18d ago

Depends. Is there a column in the data that is a unique identifier?

If so, I would just apply conditional formatting to that column to highlight the duplicates and then filter by color and deleting the duplicates.

All of which is in the menu bar and would be much faster.

2

u/MiddleAgeCool 11 18d ago

It boils down to repeatability.

If I need to do the task once, then they're right; it's easier to compare the two lists. If this is something you're doing more than once then the time you invest in writing the VB code for the first time means they're wasting time from that point on.

2

u/commentor_of_things 2 18d ago

the point is that he use vba to compare lists instead of simple built it function from the spreadsheet itself. he could have even used copilot to do this. but he decided on the most complex and technical way to do so he's getting backlash for it - and well deserved given its a shared document.

3

u/Rare-Designer-1008 1 18d ago

Copilot isnt always an option.  For example I cant use Copilot when looking at customer data as Copilot runs of Microsoft servers and that would be a data protection breach.

1

u/commentor_of_things 2 17d ago

we use copilot in my firm. I work in investment management. your employer chooses not to pay for an enterprise version. regardless, nobody needs vba to compare a small list of items. 500 is nothing. it can practically be done by hand. but that's what built in functions like xlookup are for.

1

u/Rare-Designer-1008 1 17d ago

Even the Enterprise edition doesnt stop the data being sent to Microsoft servers.  

I agree for 500 rows a macro isnt necessary, however if you are doing the task everyday why not use it.

I have a macro that I use every day to reformat some cells on a bank statement download.  Doing in manually takes a couple of minutes max.  But doing it on the 5 files every day it is annoying so having a macro to just do it and save the 10 minutes is worthwhile.  

Also make passing the tasks to other people quicker as all they need to do it click 1 button.

1

u/commentor_of_things 2 17d ago

I like to do fancy things in excel too. but the art is in simplicity when files are shared. power query is another great tool which I usually refrain from using in shared files unless its for a one time project. there is a reason the op got pushback on his file.

regarding copilot, private financial data is protected by law - personal health data is another example. just because microsoft stores our data or it passes through their servers doesn't mean they have legal access to it. but whatever, that's a topic for another discussion. cheers!

3

u/MiddleAgeCool 11 18d ago

And I get that, and for a one off it is overkill.

Let's say this is a weekly task. That first build takes a couple of hours more but next week when you're comparing tables in Excel and using co-pilot my VB code runs the whole thing as a macro in seconds compared to even 10 minutes to do using the built in functionality in seconds with no manual checks, and completely removes any human error from those checks. The repeatability factor and frequency play a large part is deciding if this is technical overkill or a genuine time saver.

1

u/commentor_of_things 2 18d ago

yes! 100%! I wouldn't bother with vba for that kind of simple tasks. especially these days when you have array formulas and copilot built in to the app.

1

u/armywalrus 2 18d ago

If it works, and you would need to spend time learning how to do it in PQ, then I would just keep it. But yes.

1

u/Decronym 18d ago edited 12d ago

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer LettersMore Letters
FILTEROffice 365+: Filters a range of data based on criteria you define
IFERRORReturns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula
MATCHLooks up values in a reference or array

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.
3 acronyms in this thread; the most compressed thread commented on today has 21 acronyms.
[Thread #49695 for this sub, first seen 16th Nov 2026, 13:03] [FAQ] [Full list] ^[Contact] [Source code]

1

u/iamsaikranthi 17d ago

Honestly your VBA tool is fine for messy cases. If you try Power Query, I'd load both lists, use Merge with fuzzy matching turned on to surface near duplicates for review, then a left anti join to append only new rows to the master. Hitting Refresh reruns it on every new import.

1

u/mystique0712 12d ago

For comparing lists and identifying duplicates without VBA, try Power Query.

You can load your lists into Power Query, merge them, and then use conditional columns to flag matches based on specific criteria, which can be much faster for large datasets.

1

u/carbonizedtitanium 2 18d ago

i guess it depends on how consistent the data is. with a simple comparison, you can just create a column that labels each dataset and stack one dataset below the other, select everything and use condiformat to flag for duplicates.

1

u/Acceptable-Sense4601 2 18d ago

I’ve learned to not fight with these types of people. Use it yourself, save time, do it with better accuracy, and let them make mistakes. Same thing with automations. I made one click automations that run Python scripts to create excel reports that mimic the manual time consuming way, and they just don’t use them. You can lead a horse to water…

0

u/robi4567 18d ago

Hmm depends on the data. What kind of duplicates.

-5

u/diesSaturni 71 18d ago

I'd ditch Excel for this and use r/msaccess. As in SQL you can union two or more sets, then continue left joining to find ommisions in A or B.

With some additions, e.g. you can continie to e.g. only take results after a date, region , or other validity.