Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc
 
Posts: n/a
Default Checking for duplicates - think this is simple

Hi. I'm not much an Excel guy, so I'm hoping someone can help me
fairly quickly. Thanks so much in advance!

I have several columns of numbers, say 10 columns of numbers with the
same number of rows (again, let's keep it simple and say 10 rows -
although I need to run this a few times against different data, so
although it will always be 10 columns, it might be 9 rows in one case,
11 rows in another).

So in my 10x10 grid of numbers, I want to see if A1 has any duplicates
in A2-A10. If it does, I want to either to mark A1 with a "*" or I
could also insert a column between A and B and make B1 = "*". But then
I want to also check A2 for any duplicates in A1 and A3-A10. And do
the same for A3 - checking for any duplicates in A1-A2 or A4-A10. Make
sense? I sure hope so. :)

The problem is, I want to do the same thing for column B, column C,
etc.

So column A could have numbers like:

70 *
73
68 *
70 *
79
68 *
....

Is there any way to do this? I guess I could set up
IF(A1=A2,"*",IF(A1=A3,"*",IF...) but that'd be a nightmare, I think.

Any help would guarantee a Christmas this year! :)

Thanks again so much!
Steve

  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel
Elkar
 
Posts: n/a
Default Checking for duplicates - think this is simple

Well, in the interest of saving Christmas, I think Conditional Formatting
might work best for you here. That way, no need to add extra columns.

Highlight your range of data
Select "Conditional Formatting" from the Format Menu
Change "Cell Value Is" to "Formula Is"
Enter the formula: =COUNTIF(A$1:A$10,A1)1
Select your formatting preference (i.e. bold, red background, etc..)
Click OK

HTH,
Elkar


" wrote:

Hi. I'm not much an Excel guy, so I'm hoping someone can help me
fairly quickly. Thanks so much in advance!

I have several columns of numbers, say 10 columns of numbers with the
same number of rows (again, let's keep it simple and say 10 rows -
although I need to run this a few times against different data, so
although it will always be 10 columns, it might be 9 rows in one case,
11 rows in another).

So in my 10x10 grid of numbers, I want to see if A1 has any duplicates
in A2-A10. If it does, I want to either to mark A1 with a "*" or I
could also insert a column between A and B and make B1 = "*". But then
I want to also check A2 for any duplicates in A1 and A3-A10. And do
the same for A3 - checking for any duplicates in A1-A2 or A4-A10. Make
sense? I sure hope so. :)

The problem is, I want to do the same thing for column B, column C,
etc.

So column A could have numbers like:

70 *
73
68 *
70 *
79
68 *
....

Is there any way to do this? I guess I could set up
IF(A1=A2,"*",IF(A1=A3,"*",IF...) but that'd be a nightmare, I think.

Any help would guarantee a Christmas this year! :)

Thanks again so much!
Steve


  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Checking for duplicates - think this is simple

How about a formula like to check for any duplicates in that range. (I shifted
things down one row to put this formula in Row 1.)

=IF(COUNT(A2:A100)=SUMPRODUCT((A2:A100<"")/COUNTIF(A2:A100,A2:A100&"")),
"No Duplicates","Some Duplicates")

This checks all that range looking for any duplicates.

If you really want to see if each cell (A1, A2, ..., A10) has any duplicates

put this in B1:
=countif(A:A,a1)
and drag down.

If you see a number different than 1, it has a duplicate.

Or...

=if(countif(a:a,a1)1,"*","")

if you want that indicator.

wrote:

Hi. I'm not much an Excel guy, so I'm hoping someone can help me
fairly quickly. Thanks so much in advance!

I have several columns of numbers, say 10 columns of numbers with the
same number of rows (again, let's keep it simple and say 10 rows -
although I need to run this a few times against different data, so
although it will always be 10 columns, it might be 9 rows in one case,
11 rows in another).

So in my 10x10 grid of numbers, I want to see if A1 has any duplicates
in A2-A10. If it does, I want to either to mark A1 with a "*" or I
could also insert a column between A and B and make B1 = "*". But then
I want to also check A2 for any duplicates in A1 and A3-A10. And do
the same for A3 - checking for any duplicates in A1-A2 or A4-A10. Make
sense? I sure hope so. :)

The problem is, I want to do the same thing for column B, column C,
etc.

So column A could have numbers like:

70 *
73
68 *
70 *
79
68 *
...

Is there any way to do this? I guess I could set up
IF(A1=A2,"*",IF(A1=A3,"*",IF...) but that'd be a nightmare, I think.

Any help would guarantee a Christmas this year! :)

Thanks again so much!
Steve


--

Dave Peterson
  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc
 
Posts: n/a
Default Checking for duplicates - think this is simple

Dave/Elkar,

Thanks so much for the replies. Dave, I used your simpilest approach,
considering my simple intellectual skills. :) It seems to work
perfectly - thanks so much!

I just wish I could do this in Access directly. That's where the data
is actually at. I suppose I'll just bring over the different
competitions into different spreadsheets and do this formula for each
individual column. I wish there was an easier way. :)

Thanks so much - this is great, though!
Steve

  #8   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel
Alex
 
Posts: n/a
Default Checking for duplicates - think this is simple

Steve

I am not sure how easy that is to do with Excel worksheet functions.

This VBA code will work. Simply select your range e.g. A1:G10 and then run
the macro:

Sub FindDuplicates()
Dim cols As Long, rws As Long, i As Long, j As Long
Dim rng As Range
Dim Target As Variant

cols = Selection.Columns.Count
rws = Selection.rows.Count

On Error Resume Next
For j = 1 To cols
For i = 1 To rws
Target = Cells(i, j)
If TypeName(Target) = "Double" Then
If
Application.WorksheetFunction.CountIf(Range(Select ion.Cells(1, j), Cells(rws,
j)), Target) 1 Then
For Each rng In Range(Selection.Cells(1, j), Cells(rws,
j))
If rng = Target Then
rng = rng & " *"
End If
Next rng
End If
End If
Next i
Next j

End Sub

Not the best piece of code, but it does work and avoids nested 'IF'
functions etc.

Regards


Alex

" wrote:

Hi. I'm not much an Excel guy, so I'm hoping someone can help me
fairly quickly. Thanks so much in advance!

I have several columns of numbers, say 10 columns of numbers with the
same number of rows (again, let's keep it simple and say 10 rows -
although I need to run this a few times against different data, so
although it will always be 10 columns, it might be 9 rows in one case,
11 rows in another).

So in my 10x10 grid of numbers, I want to see if A1 has any duplicates
in A2-A10. If it does, I want to either to mark A1 with a "*" or I
could also insert a column between A and B and make B1 = "*". But then
I want to also check A2 for any duplicates in A1 and A3-A10. And do
the same for A3 - checking for any duplicates in A1-A2 or A4-A10. Make
sense? I sure hope so. :)

The problem is, I want to do the same thing for column B, column C,
etc.

So column A could have numbers like:

70 *
73
68 *
70 *
79
68 *
....

Is there any way to do this? I guess I could set up
IF(A1=A2,"*",IF(A1=A3,"*",IF...) but that'd be a nightmare, I think.

Any help would guarantee a Christmas this year! :)

Thanks again so much!
Steve


  #9   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel
 
Posts: n/a
Default Checking for duplicates - think this is simple

Alex,

I'm not sure if you'll read this or not, but how easy would it be to
add this code to my VB6 program that does my scoring? Would I be able
to add this subprocedure and just run it?

Thanks!
Steve

  #10   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel
Alex
 
Posts: n/a
Default Checking for duplicates - think this is simple

Steve

Much of VBA / VB6 is similar so I would try it...see what happens.

I am mainly on the VBA side and not VB6 so cannot be confident in my answer
to your question...

Regards


Alex

" wrote:

Alex,

I'm not sure if you'll read this or not, but how easy would it be to
add this code to my VB6 program that does my scoring? Would I be able
to add this subprocedure and just run it?

Thanks!
Steve




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
simple chart question Shooter Excel Worksheet Functions 1 January 24th 06 09:30 PM
Simple If, Then formula for excel mike_vr Excel Discussion (Misc queries) 4 December 1st 05 04:26 PM
simple if then function amy Excel Worksheet Functions 4 July 6th 05 05:36 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Help with what should be a simple formula B Millar via OfficeKB.com Excel Worksheet Functions 2 June 16th 05 04:18 PM


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

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"