Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 94
Default REPEATING_ROWS_IDENTIFICATION

I am having list of records through columns A & B of which a number of rows of same value repeating multiple times. How can I flagging them in Col C, like "O" for original, "D" for duplicate, "T" fir triplicate, "Q" for quadruplicate and "M" for more than 4 times.?

Col A Col B Col C
NAME VALUE OCCURANCE
ABC 10 O
BCD 20 O
BCA 10 O
CAD 15 O
ABC 10 D
CBA 25 O
ABC 10 T
BCD 20 D
EFG 30 O
ABC 10 Q
BCA 10 D
CAD 15 D
ABC 10 M
CAD 15 T
ABC 10 M


Help please. Thanks.!

-via135
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default REPEATING_ROWS_IDENTIFICATION

Hi,

Am Wed, 8 Jul 2015 07:25:07 -0700 (PDT) schrieb via135:

I am having list of records through columns A & B of which a number of rows of same value repeating multiple times. How can I flagging them in Col C, like "O" for original, "D" for duplicate, "T" fir triplicate, "Q" for quadruplicate and "M" for more than 4 times.?

Col A Col B Col C
NAME VALUE OCCURANCE
ABC 10 O
BCD 20 O
BCA 10 O
CAD 15 O
ABC 10 D
CBA 25 O
ABC 10 T
BCD 20 D
EFG 30 O
ABC 10 Q
BCA 10 D
CAD 15 D
ABC 10 M
CAD 15 T
ABC 10 M


in C2 try:
=VLOOKUP(SUMPRODUCT(--($A$2:$A2=A2),--($B$2:$B2=B2)),{1,"O";2,"D";3,"T";4,"Q";5,"M"},2,1 )
and copy down.


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 94
Default REPEATING_ROWS_IDENTIFICATION

On Wednesday, 8 July 2015 20:05:44 UTC+5:30, Claus Busch wrote:
Hi,

Am Wed, 8 Jul 2015 07:25:07 -0700 (PDT) schrieb via135:

I am having list of records through columns A & B of which a number of rows of same value repeating multiple times. How can I flagging them in Col C, like "O" for original, "D" for duplicate, "T" fir triplicate, "Q" for quadruplicate and "M" for more than 4 times.?

Col A Col B Col C
NAME VALUE OCCURANCE
ABC 10 O
BCD 20 O
BCA 10 O
CAD 15 O
ABC 10 D
CBA 25 O
ABC 10 T
BCD 20 D
EFG 30 O
ABC 10 Q
BCA 10 D
CAD 15 D
ABC 10 M
CAD 15 T
ABC 10 M


in C2 try:
=VLOOKUP(SUMPRODUCT(--($A$2:$A2=A2),--($B$2:$B2=B2)),{1,"O";2,"D";3,"T";4,"Q";5,"M"},2,1 )
and copy down.


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


Dear Claus,

Thanks for the quick reply.!! I am getting absolutely right. However, I have given only 2 columns as an example. In fact I am having more than 20 columns for each row. In that case is there any other simpler format for achieving the result.?

Please let me know.!!

Regards.!

-via135
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default REPEATING_ROWS_IDENTIFICATION

Hi again,

Am Wed, 8 Jul 2015 08:03:40 -0700 (PDT) schrieb via135:

Thanks for the quick reply.!! I am getting absolutely right. However, I have given only 2 columns as an example. In fact I am having more than 20 columns for each row. In that case is there any other simpler format for achieving the result.?


qith 20 columns the formula wil be very long.
Make a helper column in U and concatenate the 20 columns:
=A2&B2&C2&D2&E2........
Then in V2:
=VLOOKUP(COUNTIF(U$2:U2,U2),{1,"O";2,"D";3,"T";4," Q";5,"M"},2,1)

Another way should be VBA


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 94
Default REPEATING_ROWS_IDENTIFICATION

On Wednesday, 8 July 2015 20:50:54 UTC+5:30, Claus Busch wrote:
Hi again,

Am Wed, 8 Jul 2015 08:03:40 -0700 (PDT) schrieb via135:

Thanks for the quick reply.!! I am getting absolutely right. However, I have given only 2 columns as an example. In fact I am having more than 20 columns for each row. In that case is there any other simpler format for achieving the result.?


qith 20 columns the formula wil be very long.
Make a helper column in U and concatenate the 20 columns:
=A2&B2&C2&D2&E2........
Then in V2:
=VLOOKUP(COUNTIF(U$2:U2,U2),{1,"O";2,"D";3,"T";4," Q";5,"M"},2,1)

Another way should be VBA


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Profession


Using the function after concatenating would be a cumbersome process, I suppose..!

So, if possible, please provide me some VB code for getting the result.!

Thanks and regards.!

-via135


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default REPEATING_ROWS_IDENTIFICATION

Hi,

Am Wed, 8 Jul 2015 08:28:48 -0700 (PDT) schrieb via135:

Using the function after concatenating would be a cumbersome process, I suppose..!


try:

Sub Test()
Dim LRow As Long, i As Long
Dim varData As Variant, varOut() As Variant
Dim myRng As Range

With ActiveSheet
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To LRow - 1
Set myRng = .Range("A2:T" & LRow)
varData = Application.Index(myRng, i, 0)
ReDim Preserve varOut(LRow - 1, 0)
varOut(i - 1, 0) = Join(Application.Index(varData, 1, 0), ",")
Next
.Range("U2").Resize(UBound(varOut)) = varOut
.Range("V2").Resize(UBound(varOut)).Formula = _

"=VLOOKUP(COUNTIF(U$2:U2,U2),{1,""O"";2,""D"";3,"" T"";4,""Q"";5,""M""},2,1)"
End With

End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
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



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