Link to home
Start Free TrialLog in
Avatar of zachvaldez
zachvaldezFlag for United States of America

asked on

Removing items from an excel file

I'm comparing 2 Excel files. File A.xls and File B.xls. If an item is on file B and also in File A, take it out in File B.xls

What is the best/smart way to go about solving this?
Avatar of Tom Farrar
Tom Farrar
Flag of United States of America image

When you say "item" do you mean column?  If so looking up Book A column values in Book B column would identify what items in A are also in B.  Those items could then be filtered in B and deleted.  Is this what you have in mind?
Avatar of zachvaldez

ASKER

sorry for not being clear. both files have 2 columns each. ID and description so there is a common column for both
So does the ID column identify the duplicate fields from A and B, or does the match require both the ID and description match.  Normally, I would think the ID by itself should indicate sameness.  If the ID can be used by itself, the formula could look like  

=iferror(vlookup(B1, $A$1:$A$100, 1, false),"")

If you are familiar with the vlookup function you'll know the ranges will vary dependent upon how many rows there are.  If the lookup brings back the A Book ID then it means the items in BookB are in BookA.  Filter on the matches and delete these from BookB.  That should get you where you want to be.  If you need more help, respond back.
There are 2 separate excel files. Each file has 2 cols each id and description.  How do you go about solving this?
Do you have to import or copy the files into one excel sheet and do the comparison there? or other methods...
First I need to know the method used to compare the ids of both.
You can do the lookup from the two workbooks or you can copy sheet from B into workbook A.  I recommend the second approach personally.  If you go to the sheet tab in B, right click, select copy/move, checkmark selected for "copy", and select Book A from the dropdown, it will copy the sheet from B into Workbook A.  From there you can do the lookup.  If you want to provide a sample two workbooks I can show you what it looks like to get the job done.
I rather see an example for a solution.
Sure.  If you will provide an example, I will provide you a solution.  Thanks..
SOLUTION
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is an example of what I was talking about.
EE.xlsx
Pleased to help