Forum

Notifications
Clear all

Compare two columns (A and B), in Column C, remove duplicated

8 Posts
3 Users
0 Reactions
116 Views
(@tangoc2)
Posts: 9
Active Member
Topic starter
 

Hello again. I have another problem.

I have a set of dates in Column A, another set of dates in Column B, I want to compare this two column of dates, so that if any dates exists in Column B, it will not copy in Column C. So Column C basically are the dates from Column A, just that if any of the dates appear in both Column A and B, it will not show in Column C.

I try to use a vba to do it, but it didn't do the job. I attached my works for your information.

Any thoughts?

 
Posted : 20/01/2023 9:31 pm
(@keebellah)
Posts: 373
Reputable Member
 

Please reattach the file as a real attachment cannot download it as you have done now

 
Posted : 23/01/2023 5:33 pm
Anders Sehlstedt
(@sehlsan)
Posts: 970
Prominent Member
 

Hello,

Take a look at the Excel compare two lists blog post, it describes how to use Power Query to compare two lists.

Br,
Anders

 
Posted : 23/01/2023 5:34 pm
(@tangoc2)
Posts: 9
Active Member
Topic starter
 

Hello Anders, no joy, I try to use power query in my worksheet. But once I merge, all dates in column A still paste to the new column, even the date exists in column B.

Hi Hans, I upload my file again, please right click the link and select "save link as" if you are using chrome.

 
Posted : 24/01/2023 9:26 am
Anders Sehlstedt
(@sehlsan)
Posts: 970
Prominent Member
 

Hello,

You didn't complete all the steps in Power Query.
See attached file for the finished version. There are two dates in column A that also exists in column C, those are removed.

Br,
Anders

 
Posted : 24/01/2023 3:04 pm
(@tangoc2)
Posts: 9
Active Member
Topic starter
 

Thanks Ander, I think is my version of excel. I understand that my previous attachment didn't finish the power query because when I try, the result didn't exclude that 2 days in the new sheet like yours.

When I open yours attachment and try to refresh the query. A warning box show up and said the power query is not compatible with my current version.

Anyway, I guess I know what is going on now.

Thank you very much indeed.

 
Posted : 24/01/2023 10:17 pm
Anders Sehlstedt
(@sehlsan)
Posts: 970
Prominent Member
 

Hello,

Well, if you are using an old version of Excel it might be that Power Query is not the right tool.
Attached is a variant where I use a helper column to get the dates list in a pivot table.

Br,
Anders

 
Posted : 25/01/2023 3:38 pm
(@tangoc2)
Posts: 9
Active Member
Topic starter
 

Thank you so much on your nice work indeed Anders.
Good man!

 
Posted : 26/01/2023 8:44 am
Share: