Comparing two columns

kbreen

New Member
Joined
Aug 26, 2002
Messages
7
HI,
I HAVE TWO COLUMNS POPULATED WITH COMPANY NAMES. ONE COLUMN HAS, LET'S SAY, 700 NAMES AND THE OTHER HAS 1,500. WHAT I NEED TO DO IS COMPARE THE TWO COLUMNS SO I CAN FIND OUT, (PERHAPS IN A NEW THIRD COLUMN) WHICH COMPANIES ARE IN BOTH OF THE TWO COLUMNS. IS THERE A WAY TO DO THIS INSTEAD OF DOING A MANUAL, SIDE-BY-SIDE COPY AND PASTE JOB?
THX,
KB
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Well, since I'm onto SQL this days, I would suggest doing an external query, using the Excel file where you have your lists, and using an SQL command like this:

SELECT `Sheet1$`.Name
FROM `C:Test`.`Sheet1$` `Sheet1$`, `C:Test`.`Sheet2$` `Sheet2$`
WHERE `Sheet1$`.Name= `Sheet2$`.Name

basically, you're creating an intersection between the two lists and returning the results.
 
Upvote 0
On 2002-10-09 16:41, kbreen wrote:
HI,
I HAVE TWO COLUMNS POPULATED WITH COMPANY NAMES. ONE COLUMN HAS, LET'S SAY, 700 NAMES AND THE OTHER HAS 1,500. WHAT I NEED TO DO IS COMPARE THE TWO COLUMNS SO I CAN FIND OUT, (PERHAPS IN A NEW THIRD COLUMN) WHICH COMPANIES ARE IN BOTH OF THE TWO COLUMNS. IS THERE A WAY TO DO THIS INSTEAD OF DOING A MANUAL, SIDE-BY-SIDE COPY AND PASTE JOB?
THX,
KB
kbreen, don't know if this is exactly what you are after but this should return in column C all matches between column A & B

=IF(COUNTIF(A1:$B$1,$B$1500),"",A1)

what this formula does is looks at the reference in col A and searches the list in Col B and returns the reference if it exists - only returns unique records. Copy this formula into all cells in col C. The formula ha been based on the fact that col B contains the longer list
 
Upvote 0

Forum statistics

Threads
1,224,396
Messages
6,178,394
Members
452,844
Latest member
Shebl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top