Solved

Compare values in 2 columns and populate another column with the results

Posted on 2011-02-16
12
249 Views
Last Modified: 2012-05-11
Hello Everyone,

I have an excel spreadsheet that I need to compare two columns of text to find values that match then populate another column with the results.

My first column (A) has 94,000 rows of data.  I have to compare that to my second column (J) that has about 30,000 rows.  For values that match I have to populate another column (B) with a "yes" if there is a match.  

Is there a macro that can do this for me?
0
Comment
Question by:cyardley
  • 5
  • 5
  • 2
12 Comments
 
LVL 11

Expert Comment

by:Runrigger
ID: 34906633
if(A1 = B1,"Yes","No") - provided that the values to compare are in the same row!

alternative if 2 lists;

if(iserror(vlookup(a1,$b$1:$b$30000,1,false)),"No","Yes")
0
 
LVL 11

Expert Comment

by:Runrigger
ID: 34906641
the vlookup simply attempts to determine if the value in column A is contained (exactly) within the list in column B
0
 
LVL 33

Expert Comment

by:jppinto
ID: 34906649
Use this formula on column C if you data is on columns A and B:

=IF(ISNA(VLOOKUP(B1;A:A,1,FALSE)),"","Yes")

jppinto
0
 
LVL 33

Expert Comment

by:jppinto
ID: 34906680
Please check the attached example...

jppinto
VLOOKUP.xlsx
0
 
LVL 11

Accepted Solution

by:
Runrigger earned 500 total points
ID: 34906684
actually, we both read this wrong;

=if(iserror(vlookup(A1,$J$1:$J$30000,1,false)),"No","Yes")

To re-iterate, this is confirming that the value in column is listed in column J, correct?
0
 
LVL 11

Expert Comment

by:Runrigger
ID: 34906693
To re-iterate, this is confirming that the value in column is listed in column J, correct?

--->>>>> shoudl have been

To re-iterate, this is confirming that the value in column A is listed in column J, correct?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Closing Comment

by:cyardley
ID: 34906745
Thank You Runrigger!  I should have realized that a vlookup would have worked.
0
 
LVL 33

Expert Comment

by:jppinto
ID: 34906859
Did you at least looked at my posts??!
0
 
LVL 11

Expert Comment

by:Runrigger
ID: 34906919
jppinto, I believe that your lookup was the wrong way around!
0
 
LVL 33

Expert Comment

by:jppinto
ID: 34906935
You're right... :) I missed that! LOLOL
0
 

Author Comment

by:cyardley
ID: 34906966
Hi jppinto,

I did and runrigger is correct it was the wrong way around.  I think I may have caused that confusion with my wording.  I really do appreciate your quick response and value this site and all of the people on here that have helped me.  Again my apologies if there was any confusion.

0
 
LVL 33

Expert Comment

by:jppinto
ID: 34907048
No problem...I misread the question. Maybe next time... :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
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 …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

929 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

10 Experts available now in Live!

Get 1:1 Help Now