Solved

Compare 2 Excel-sheets

Posted on 2013-06-14
8
182 Views
Last Modified: 2013-06-20
Hi,

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.

J.
0
Comment
Question by:janhoedt
8 Comments
 
LVL 29

Expert Comment

by:gowflow
ID: 39248231
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
gowflow
0
 
LVL 5

Expert Comment

by:DOSLover
ID: 39248277
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'.  
=VLOOKUP(A2,Sheet2!A:A,1)=A2

Open in new window

0
 

Author Comment

by:janhoedt
ID: 39248621
Thanks, I m not in the office now. Will check Monday and update this entry!
0
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

Author Comment

by:janhoedt
ID: 39252400
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 ....
Comparison.xlsx
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 39257555
>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:
=MATCH(B2,'New-Program-Export'!A:A,0)

Open in new window

On the second sheet, put something like this:
=MATCH(A2,Sharepoint!B:B,0)

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.
0
 
LVL 5

Accepted Solution

by:
DOSLover earned 500 total points
ID: 39258256
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.
EE-Comparison.xlsx
0
 

Author Comment

by:janhoedt
ID: 39258675
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?
0
 
LVL 5

Expert Comment

by:DOSLover
ID: 39259887
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.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question