Compare 2 Excel-sheets


I'd need to compare the content of 2 Excels.
Both of them contain a list of servers.

Excel1: the servername column is "hostname" (no filter needed there).
Excel2: I filtered out Linux-servers (which I don't need) in Excel1, the column of servers there is named "Name"

How can I compare both sheets and have an overview of which servers are in sheet 1 but not in sheet 2?

In other words, f.e. is server1 in excel1 also there in excel2, is server22 in excel1 also there in excel2 etc.

Who is Participating?
DOSLoverConnect With a Mentor Commented:
I am re-attaching the spreadsheet after putting in the formulas in 'Comparison' sheet. I am comparing 'Hosts' column of SharePoint sheet to values of 'Name' column of 'New-Program-Export'. Also please note that I also added a new row for 'PHIWIN044' in 'New-Program-Export' so that at least one value matches in your sample sheet.
The formula uses 'VLOOKUP', IF and ISNA functions.
several questions

1) 2 Excel means 2 workbook ? or 2 sheets in 1 workbook ?
2) The best thing we can do is use colors we can agree say Yellow in Sheet1 for any item would mean this items does not exist in sheet2 and Green in Sheet2 on any item would mean the item does not exist in sheet1 or anything else you may think that would help your search and basis this we can then develop the vba

The best would be for you to just attach and sample workbook
A simple VLOOKUP function can help in this situation. Assuming Sheet1 has 'hostname's in 'A' column, and Sheet2 has 'Names' in column A, we can use the following function in Cell B2. Then formula can be copied all remaining cells of Sheet1 Column B. It searches Sheet2 for value contained in A2, and returns a value of 'TRUE' or 'FALSE'.  

Open in new window

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

janhoedtAuthor Commented:
Thanks, I m not in the office now. Will check Monday and update this entry!
janhoedtAuthor Commented:
In att. the file, please advise.
Note: values in sheet 2 might also not exist in sheet 1 and should be visible in the comparsion.

Note: cannot make vlookup work ....
>How can I compare both sheets and have an overview of which servers are in sheet 1 but not in sheet 2?

One way I know to locate something in a list is to add an adjacent column and use a MATCH.

Assuming that column B of sheet "Sharepoint" has the server "Hostname"s to match in "New-Program-Export"'s column A (Name) then you'll need a column in each to compare against the other.

On the first sheet, put  something like this:

Open in new window

On the second sheet, put something like this:

Open in new window

Anything that shows #N/A does not have a matching item.
Anything with a number is the row (when using the specified formula) where a match was found.
janhoedtAuthor Commented:
Thanks! Works great! Can you explain me the forumla step by step?
I understand the VLOOKUP, then the range  A:A but then 1 and false? And what about ISNA, where does it stand for?
I am glad it works for you.
You have the VLOOKUP part right - it checks a value of Cell A2 of SharePoint to see if it exists in cell-range A:A of New-Program-Export sheet. Option '1' tells to get value from the 1st column if a match is found. Since we are using only one column range (A:A), it picks up from the same column. Option 'FALSE' tells it NOT to use an approximate match - that is it should find an exact match.
Next, say, if match is not found, VLOOKUP returns a value of #N/A. The 'ISNA' function checks if VLOOKUP is returning '#N/A'. I am using a IF condition to see if ISNA is true, then 'NOTFound', else a value was 'Found'.
I hope that helps.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.