Solved

Compare 2 Excel-sheets

Posted on 2013-06-14
8
160 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now