Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
deathswan
 
Posts: n/a
Default Removing Duplicate Pairs(2 Columns)


Hello. I have 2 columns order_no and item_no. Duplicates are allowed in
each column separately, however I would like to remove all duplicate
"pairs" of order_no and item_no. So for instance (order_no, item_no) -
[(1, 4) and (1, 4)] would be deleted, but [(1, 3) and (1, 4)] OR [(1, 3)
and (2, 3)] would be be allowed. The 2 columns are right next to each
other (order_no is column C, item_no is column D).

Thanks!
[kyle]


--
deathswan
------------------------------------------------------------------------
deathswan's Profile: http://www.excelforum.com/member.php...o&userid=33060
View this thread: http://www.excelforum.com/showthread...hreadid=528765

  #2   Report Post  
Posted to microsoft.public.excel.misc
Herbert Seidenberg
 
Posts: n/a
Default Removing Duplicate Pairs(2 Columns)

Here is a solution that requires a helper column
and Advanced Filter.
Assume your data looks like this:
Order Item Bin
2 2 22
3 5 53
3 1 13
4 5 54
2 1 12
1 5 51
4 3 34
1 4 41
5 3 35
4 1 14

Criteria
Test
TRUE

order item
3 1
4 5
2 1
1 5
4 3

Bin is the helper column.
Select the 11x3 array that includes the headers
Order, Item and Bin.
Insert Name Create Top Row
Do the same thing for the 3 cells that include Criteria.
Select the 11x2 array (leave out Bin) and
Insert Name Define Name in Worksheet: Database
Fill the Bin column with this formula:
=10*Item+Order
Into the cell that says TRUE, enter this formula:
=NOT(COUNTIF(Bin,10*Order+Item))
Data Filter Advanced Filter Copy to another location
List Range: Type in Database, or accept default
Criteria Range: Type in Criteria, or accept default
Copy To: Specify a location
If the numbers in Item and Order have more digits,
add a zero to the 10 for each addittional digit.
If the Item and Order numbers are very large,
use concatenate instead of multiply/add.

  #3   Report Post  
Posted to microsoft.public.excel.misc
tjtjjtjt
 
Posts: n/a
Default Removing Duplicate Pairs(2 Columns)

Without knowing more about your data (are there other columns besides C and D
to worry about, for instance), I would do this: Instead of deleting the
duplicates, I would extract the unique values.

Click a cell in your data. In the Data menu, point to Filter and click
Advanced Filter. If you clicked in the data first, the List Range should be
filled in already. Click the Copy to another location Option button and
select the Unique records only check box.
Click a cell to start in-- I used I1-- and click OK. Excel will extract
only the unique combinations.

--
tj


"deathswan" wrote:


Hello. I have 2 columns order_no and item_no. Duplicates are allowed in
each column separately, however I would like to remove all duplicate
"pairs" of order_no and item_no. So for instance (order_no, item_no) -
[(1, 4) and (1, 4)] would be deleted, but [(1, 3) and (1, 4)] OR [(1, 3)
and (2, 3)] would be be allowed. The 2 columns are right next to each
other (order_no is column C, item_no is column D).

Thanks!
[kyle]


--
deathswan
------------------------------------------------------------------------
deathswan's Profile: http://www.excelforum.com/member.php...o&userid=33060
View this thread: http://www.excelforum.com/showthread...hreadid=528765


  #4   Report Post  
Posted to microsoft.public.excel.misc
tjtjjtjt
 
Posts: n/a
Default Removing Duplicate Pairs(2 Columns)

I seem to have misread your question. Please disregard my previous post.
--
tj


"tjtjjtjt" wrote:

Without knowing more about your data (are there other columns besides C and D
to worry about, for instance), I would do this: Instead of deleting the
duplicates, I would extract the unique values.

Click a cell in your data. In the Data menu, point to Filter and click
Advanced Filter. If you clicked in the data first, the List Range should be
filled in already. Click the Copy to another location Option button and
select the Unique records only check box.
Click a cell to start in-- I used I1-- and click OK. Excel will extract
only the unique combinations.

--
tj


"deathswan" wrote:


Hello. I have 2 columns order_no and item_no. Duplicates are allowed in
each column separately, however I would like to remove all duplicate
"pairs" of order_no and item_no. So for instance (order_no, item_no) -
[(1, 4) and (1, 4)] would be deleted, but [(1, 3) and (1, 4)] OR [(1, 3)
and (2, 3)] would be be allowed. The 2 columns are right next to each
other (order_no is column C, item_no is column D).

Thanks!
[kyle]


--
deathswan
------------------------------------------------------------------------
deathswan's Profile: http://www.excelforum.com/member.php...o&userid=33060
View this thread: http://www.excelforum.com/showthread...hreadid=528765


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
Removing all duplicate records except one copy adam a Excel Discussion (Misc queries) 8 August 30th 05 05:53 AM
removing duplicate records in excel, how to do it? Don Excel Discussion (Misc queries) 3 July 27th 05 01:45 AM
Arithmetical Mode of Criteria in Multiple Non-Adjacent columns Sam via OfficeKB.com Excel Worksheet Functions 4 July 14th 05 09:15 PM
Hidden Columns in Shared Workbooks Rotary Excel Discussion (Misc queries) 1 July 9th 05 12:28 AM
Removing Near-Duplicate Rows, Leaving Those w/Most Data in Specific Columns foofoo Excel Discussion (Misc queries) 1 April 2nd 05 12:02 AM


All times are GMT +1. The time now is 05:12 AM.

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

About Us

"It's about Microsoft Excel"