Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Finding Duplicate Arrays in a table

Hi,

I have a table with several rows and columns of information. I will
continue to add new information new rows and I want to make sure that I never
have duplicate a row.

So here is a simple example:

A B C
1 i 1 k

2 r 3 n

3 a 2 f

4 a 1 f

5
I want to be able to add another row of information and if the array in that
row from columns a to c matches an array I already have I want to be notified
and it would also be nice to know which array I am duplicating.

Can anyone help?

Thanks,
John
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default Finding Duplicate Arrays in a table

This assumes you are familiar with dynamically named ranges.
Name the maximum size of your table.
Insert Name Define Names in Workbook ArrT
Refers to: =$A$1:$C$100 for a 3x100 array
Also define the following names
LenArr
Refers to: =COUNTA(INDEX(ArrT,,1))
ArrN
Refers to: =INDEX(ArrT,1,):INDEX(ArrT,LenArr,)
Fac1
Refers to: =--(INDEX(ArrN,LenArr,1)=INDEX(ArrN,,1))
Fac2
Refers to: =--(INDEX(ArrN,LenArr,2)=INDEX(ArrN,,2))
Fac3
Refers to: =--(INDEX(ArrN,LenArr,3)=INDEX(ArrN,,3))
Continue like this if you have more than 3 columns
If this formula is greater than 1, the last row entry is a duplicate:
=SUMPRODUCT(Fac1*Fac2*Fac3)
You can conditionally format this cell to draw your attention.
This formula will give you the location of the duplicate row:
=SUMPRODUCT(Fac1*Fac2*Fac3*ROW(ArrN))-LenArr

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Finding Duplicate Arrays in a table

Wow I setup up a simple case and this is going to work great!!! Thank you so
much. I have one question though I have a total of 96 columns so is there a
way to accomodate that or should I define 96 Fac#s? I'm fine with doing that
if I have to, because I'm glad you gave me this solution, but just thought I
would ask.

Thank You,
John

"Herbert Seidenberg" wrote:

This assumes you are familiar with dynamically named ranges.
Name the maximum size of your table.
Insert Name Define Names in Workbook ArrT
Refers to: =$A$1:$C$100 for a 3x100 array
Also define the following names
LenArr
Refers to: =COUNTA(INDEX(ArrT,,1))
ArrN
Refers to: =INDEX(ArrT,1,):INDEX(ArrT,LenArr,)
Fac1
Refers to: =--(INDEX(ArrN,LenArr,1)=INDEX(ArrN,,1))
Fac2
Refers to: =--(INDEX(ArrN,LenArr,2)=INDEX(ArrN,,2))
Fac3
Refers to: =--(INDEX(ArrN,LenArr,3)=INDEX(ArrN,,3))
Continue like this if you have more than 3 columns
If this formula is greater than 1, the last row entry is a duplicate:
=SUMPRODUCT(Fac1*Fac2*Fac3)
You can conditionally format this cell to draw your attention.
This formula will give you the location of the duplicate row:
=SUMPRODUCT(Fac1*Fac2*Fac3*ROW(ArrN))-LenArr


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default Finding Duplicate Arrays in a table

Excel limits the number of terms in SUMPRODUCT() to 30,
so you cannot expand my formulas to 96 columns.
If your data is somewhat random, then even if you have just 10 columns,
the chances of rows repeating are astronomical.
Even so, it can be done with a huge increase in complexity and
spreadsheet space.
The hidden named arrays have to be turned into visible, dynamic arrays.
ArrV is a 96x100 array with this array formula:
=--(INDEX(ArrN,LenArr,COLUMN(ArrN))=INDEX(ArrN,,COLUM N(ArrN)))
ArrE refers to: =ROW(INDEX(ArrV,1,):INDEX(ArrV,COLUMNS(ArrV),))^0
ArrM is a 1x100 array with this array formula:
=MMULT(ArrV,ArrE)
and the flag (1) formula is:
=COUNTIF(ArrM,96)

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Finding Duplicate Arrays in a table

Hi,
I would like to know how to achieve the same task using the VBA tool.
Ideally I would like to get the Item Number (located in the first column) of
the array Im duplicating in a message box.

Any help would be greatly appreciated!

--
Edwin


"Herbert Seidenberg" wrote:

Excel limits the number of terms in SUMPRODUCT() to 30,
so you cannot expand my formulas to 96 columns.
If your data is somewhat random, then even if you have just 10 columns,
the chances of rows repeating are astronomical.
Even so, it can be done with a huge increase in complexity and
spreadsheet space.
The hidden named arrays have to be turned into visible, dynamic arrays.
ArrV is a 96x100 array with this array formula:
=--(INDEX(ArrN,LenArr,COLUMN(ArrN))=INDEX(ArrN,,COLUM N(ArrN)))
ArrE refers to: =ROW(INDEX(ArrV,1,):INDEX(ArrV,COLUMNS(ArrV),))^0
ArrM is a 1x100 array with this array formula:
=MMULT(ArrV,ArrE)
and the flag (1) formula is:
=COUNTIF(ArrM,96)


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
finding duplicate addresses diamonds Excel Worksheet Functions 2 June 21st 06 11:40 PM
finding value from table andyell Excel Worksheet Functions 4 June 10th 06 12:25 AM
Finding DUplicate Data set in Worksheets SAT Excel Worksheet Functions 4 September 17th 05 11:50 PM
Finding duplicate records in Excel KG Excel Discussion (Misc queries) 2 December 22nd 04 07:44 PM
Finding duplicate nuumbers in a column Johnny the hat Excel Worksheet Functions 2 October 29th 04 03:28 PM


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