Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Compare two sheets in excel

Posted on 2016-09-16
9
Medium Priority
?
29 Views
Last Modified: 2016-10-07
=IF(ISNA(VLOOKUP(A2,SHEET1!$A$2:$A$70000,1,FALSE)),"NO","YES")

Trying to compare two sheets with the values from A2 if it matches the value on the other sheet any thing in the column
0
Comment
Question by:Jorge Ocampo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 41802350
I see no issue with your formula (tested in an example workbook).  What seems to be the problem?

-Glenn
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 41802355
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 41802358
in sheet test1 line 9 matches with test2 when its incorrect :(
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Accepted Solution

by:
Glenn Ray earned 1000 total points (awarded by participants)
ID: 41802364
Your formulas in the workbook are using the TRUE argument in the VLOOKUP instead of FALSE.  They're also looking for 100 columns across; should just be 1.  Your example was correct.

They should be:
[Test1] sheet, B2:  =IF(ISNA(VLOOKUP(A2,TEST2!$A$2:$A$70000,1,FALSE)),"NO","YES")
[Test2] sheet, B2:  =IF(ISNA(VLOOKUP(A2,TEST1!$A$2:$A$70000,1,FALSE)),"NO","YES")

-Glenn
0
 
LVL 32

Assisted Solution

by:Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj) earned 500 total points (awarded by participants)
ID: 41802631
You may also use the following functions to get the desired output...

On Test1,
In B2
=IF(ISNUMBER(MATCH(A2,TEST2!A:A,0)),"Yes","No")

Open in new window


On Test2,
In B2
=IF(ISNUMBER(MATCH(A2,TEST1!A:A,0)),"Yes","No")

Open in new window

0
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 41803229
^Those work.  So do these:

[Test1] sheet, B2:  =IF(COUNTIF(TEST2!$A$2:$A$70000,A2)>0,"YES","NO")
[Test2] sheet, B2:  =IF(COUNTIF(TEST1!$A$2:$A$70000,A2)>0,"YES","NO")

But it's also important for the requester to understand why the formalas didn't work.

-Glenn
0
 
LVL 32

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41803240
@Glenn
The advantage of Match over Countif is, in Match you can reference the whole columns and the formula will not be evaluated for the whole columns and will stop once it finds the first occurrence of lookup value. So it will be comparatively faster than countif.
0
 
LVL 7

Assisted Solution

by:tomfarrar
tomfarrar earned 500 total points (awarded by participants)
ID: 41804004
If you want to see the comparison side-by-side, you could also add a column to both sheets and create a pivot table which points out the differences.  See attached,  Just a thought...
EE.xlsx
0
 
LVL 32

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41833335
The chosen answers resolved the question.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

715 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