Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default common numbers in 2 columns

I have two columns of numbers. One is a large list with say 3,000
random
serial numbers. The other is a smaller list of 800 serial numbers. I
want to
find if any serial numbers are listed in both of the columns. I want to
identify which number appear in both columns and move them to another
column, or at least highlight them. I tried to follow the advice given
to an earlier post but could not make it work for me: perhaps I need a
simpler or more detailed explanation.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default common numbers in 2 columns

"aubudgo" wrote:
I have two columns of numbers. One is a large list with say 3,000
random serial numbers. The other is a smaller list of 800 serial numbers.
I want to find if any serial numbers are listed in both of the columns. I want to
identify which number appear in both columns and move them to another
column, or at least highlight them ..


Try one way via non-array formulas, re this recent post:
http://tinyurl.com/rdhdf

Note that the formula in D2 is just a sweet copy across of the one placed in
C2. To compare it the other way around (compare col B against col A, and
slice the matched and unmatched items into cols C and D), just make a copy of
the original sheet (where col A is compared against col B), then swap the 2
source lists in cols A and B around.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default common numbers in 2 columns


Hi

I've post an example of two ways to skin this cat

Also a useful link on Vlookup's
http://www.ozgrid.com/Excel/excel-vlookup-formula.htm


http://cjoint.com/?hwkSkkmizO

VBA Noob


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=563950

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 695
Default common numbers in 2 columns

compare column B with A and color all cells ind A equal to cells in B

Sub dub()
Dim r As Single, s As Single
Range("a1:a3000").Interior.ColorIndex = xlNone
For r = 1 To 800
For s = 1 To 3000
If Cells(r, 2) = Cells(s, 1) Then If Cells(r, 2) < "" Then Cells(s,
1).Interior.ColorIndex = 3
Next
Next

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default common numbers in 2 columns

Highlight Duplicates with Conditional Formatting:-

Assuming that the first range is A1:A800 and the second range is in column B
starting at B1:
1. Select all the cells of the second range (column B)
2. Select Format Conditional Formatting
3. Select "Formula Is" from the left dropdown
4. Paste this formula (use Ctrl + V to paste):
=COUNTIF($A$1:$A$800, B1) 0
5. Click the Format button and select the desired format option
6. Click OK to close the Format Cells dialog
7. Click OK to close the Conditional Formatting dialog

Note that if the either range will change in size then using a dynamic named
range is suggested. See http://www.contextures.com/xlNames01.html#Dynamic

Macro that Copies Duplicates to a Third Column:-

Sub CopyDups()
Dim r1 As Range, r2 As Range, r3 As Range
Dim c As Range

Set r1 = Range(Range("A1"), Range("A1").End(xlDown))
Set r2 = Range(Range("B1"), Range("B1").End(xlDown))
For Each c In r2.Cells
If Application.CountIf(r1, c) 0 Then
If r3 Is Nothing Then
Set r3 = Range("C1")
r3 = c.Value
Else
If Application.CountIf(r3, c) = 0 Then
Set r3 = r3.Resize(r3.Count + 1, 1)
r3(r3.Count, 1) = c.Value
End If
End If
End If
Next
End Sub

Note that the above macro shouldn't list duplicates more than once if they
are repeated in the first (larger) range. Also note that it was written just
now (for you) in a hurry with minimal testing. It should be tested
rigorously. That's your job. Change range references to suit. Hope it does
the job.

Regards,
Greg


"aubudgo" wrote:

I have two columns of numbers. One is a large list with say 3,000
random
serial numbers. The other is a smaller list of 800 serial numbers. I
want to
find if any serial numbers are listed in both of the columns. I want to
identify which number appear in both columns and move them to another
column, or at least highlight them. I tried to follow the advice given
to an earlier post but could not make it work for me: perhaps I need a
simpler or more detailed explanation.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default common numbers in 2 columns

.. just make a copy of the original sheet (where col A is compared
against col B), then swap the 2 source lists in cols A and B around.


To "swap", in the copied sheet, clear cols A and B (select the cols and
press Delete key), then go back to the original sheet and copy col A, paste
it into col B in the copied sheet, then repeat to copy & paste col B from the
original into col A in the copied sheet. Then just ensure that the formula
fills are sufficient to cover the new data extent in col A. Do not delete
the cols as this will foul up the formulas.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listing Common Symbols Of 2 Columns Manfred Excel Discussion (Misc queries) 3 April 1st 06 05:37 AM
Add numbers accross columns after stripping away text gavin Excel Discussion (Misc queries) 10 May 23rd 05 07:50 PM
Columns in Excel are numbers instead of letters, how do I change . barnes76 Excel Discussion (Misc queries) 5 February 14th 05 01:07 AM
In Excel can you merge two columns i.e. street numbers and addres. Aaronhaus Excel Worksheet Functions 1 January 6th 05 01:34 PM
how to build a formula to match numbers in 2 columns with the equ. mcdilash Excel Worksheet Functions 1 November 10th 04 05:31 PM


All times are GMT +1. The time now is 12:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"