Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unique records of matching pairs


Hello!
I need to filter unique records acording to two columms (10xy and
error).
I want the unique ocurrences of this pairs of columms independently of
the other columms.

I have tried with advanced filter but if the columm ID is diferent and
the pair (10xy and error) is the same, it will give me another record
that i don't want.

I have an example attached. In yellow the result that i want.

Thank“s :)


+-------------------------------------------------------------------+
|Filename: tests.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3946 |
+-------------------------------------------------------------------+

--
pmarques
------------------------------------------------------------------------
pmarques's Profile: http://www.excelforum.com/member.php...o&userid=25110
View this thread: http://www.excelforum.com/showthread...hreadid=479143

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Unique records of matching pairs

The easiest way is to concatenate the two fields together in a new column and
then filter that for unique items.
--
HTH...

Jim Thomlinson


"pmarques" wrote:


Hello!
I need to filter unique records acording to two columms (10xy and
error).
I want the unique ocurrences of this pairs of columms independently of
the other columms.

I have tried with advanced filter but if the columm ID is diferent and
the pair (10xy and error) is the same, it will give me another record
that i don't want.

I have an example attached. In yellow the result that i want.

ThankĀ“s :)


+-------------------------------------------------------------------+
|Filename: tests.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3946 |
+-------------------------------------------------------------------+

--
pmarques
------------------------------------------------------------------------
pmarques's Profile: http://www.excelforum.com/member.php...o&userid=25110
View this thread: http://www.excelforum.com/showthread...hreadid=479143


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Unique records of matching pairs

Hi,
These few lines of code worked OK on your test file. As per Jim's
reply, I concatenated columns B & E in column F. Then just execute module.

HTH

Sub GetUnique()

lastrow = Cells(Rows.Count, "A").End(xlUp).Row

Set ConRng = Range("F6:F" & lastrow) ' Concatenation of "10XY" and "Error"

j = 6 ' Output row
r = 6 ' First input row

Do While r < lastrow
Range(Cells(r, "A"), Cells(r, "E")).Copy Cells(j, "G") 'Output first
record
j = j + 1 ' Increment count of output row
n = Application.CountIf(ConRng, Cells(r, "B") & Cells(r, "E")) ' Count
of records with this key
r = r + n ' set to next concatenated key
Loop

End Sub

"Jim Thomlinson" wrote:

The easiest way is to concatenate the two fields together in a new column and
then filter that for unique items.
--
HTH...

Jim Thomlinson


"pmarques" wrote:


Hello!
I need to filter unique records acording to two columms (10xy and
error).
I want the unique ocurrences of this pairs of columms independently of
the other columms.

I have tried with advanced filter but if the columm ID is diferent and
the pair (10xy and error) is the same, it will give me another record
that i don't want.

I have an example attached. In yellow the result that i want.

ThankĀ“s :)


+-------------------------------------------------------------------+
|Filename: tests.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3946 |
+-------------------------------------------------------------------+

--
pmarques
------------------------------------------------------------------------
pmarques's Profile: http://www.excelforum.com/member.php...o&userid=25110
View this thread: http://www.excelforum.com/showthread...hreadid=479143


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
Matching pairs of Data in cell whatzzup Excel Discussion (Misc queries) 1 May 28th 10 08:25 PM
Filer for unique records and return all column data for unique rec bseeley Excel Discussion (Misc queries) 1 September 12th 09 12:17 AM
Counting Unique Pairs of Cells Makaron Excel Discussion (Misc queries) 6 June 17th 08 10:43 PM
unique filter results in some non-unique records. Serials Librarian Excel Discussion (Misc queries) 2 May 26th 06 09:58 PM
Unique records of matching pairs pmarques Excel Worksheet Functions 0 October 25th 05 05:23 PM


All times are GMT +1. The time now is 11:01 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"