Solved

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

Posted on 2011-02-16
12
248 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Please check the attached example...

jppinto
VLOOKUP.xlsx
0
 
LVL 11

Accepted Solution

by:
Runrigger earned 500 total points
Comment Utility
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
Comment Utility
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
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

 

Author Closing Comment

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

Expert Comment

by:jppinto
Comment Utility
Did you at least looked at my posts??!
0
 
LVL 11

Expert Comment

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

Expert Comment

by:jppinto
Comment Utility
You're right... :) I missed that! LOLOL
0
 

Author Comment

by:cyardley
Comment Utility
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
Comment Utility
No problem...I misread the question. Maybe next time... :)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

743 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

18 Experts available now in Live!

Get 1:1 Help Now