#1   Report Post  
Posted to microsoft.public.excel.misc
flow23
 
Posts: n/a
Default Duplicates

I have two columns..

ID MONTH
100 Jan-04 Unique
200 Jan-04 Unique
200 Jan-04
300 Feb-04 Unique
300 Feb-04
300 Feb-04


what I want is a macro to write "Unique" in the third column if " ID " is
there only once in a month. and in case its there more than once in the same
month. only one "Unique" in the third column


any help apprecaited


  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Duplicates

Pt this in C2 and copy down

=IF(SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2=B2))1,"","Unique")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"flow23" wrote in message
...
I have two columns..

ID MONTH
100 Jan-04 Unique
200 Jan-04 Unique
200 Jan-04
300 Feb-04 Unique
300 Feb-04
300 Feb-04


what I want is a macro to write "Unique" in the third column if " ID " is
there only once in a month. and in case its there more than once in the

same
month. only one "Unique" in the third column


any help apprecaited




  #3   Report Post  
Posted to microsoft.public.excel.misc
John James
 
Posts: n/a
Default Duplicates


If ID number doesn't repeat in a following month, in cell C2 enter:
=IF(COUNTIF($A$2:A2,A2)=1,"Unique","")

Then copy down


--
John James
------------------------------------------------------------------------
John James's Profile: http://www.excelforum.com/member.php...o&userid=32690
View this thread: http://www.excelforum.com/showthread...hreadid=531468

  #4   Report Post  
Posted to microsoft.public.excel.misc
John James
 
Posts: n/a
Default Duplicates


Otherwise, if, for example, 100 Jan is meant to be different to 100 Feb
then enter in cell C2:
=A2&B2
and enter in cell D2:
=IF(COUNTIF($C$2:C2,C2)=1,"Unique","")

Copy these formulae down and hide column C if desired.


--
John James
------------------------------------------------------------------------
John James's Profile: http://www.excelforum.com/member.php...o&userid=32690
View this thread: http://www.excelforum.com/showthread...hreadid=531468

  #5   Report Post  
Posted to microsoft.public.excel.misc
flow23
 
Posts: n/a
Default Duplicates

Thanks It works great.
I also added few more arrays to it and incorporated it into a macro.

but the problem is speed.
there are 12000 records

anyway to do it quicker?

"Bob Phillips" wrote:

Pt this in C2 and copy down

=IF(SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2=B2))1,"","Unique")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"flow23" wrote in message
...
I have two columns..

ID MONTH
100 Jan-04 Unique
200 Jan-04 Unique
200 Jan-04
300 Feb-04 Unique
300 Feb-04
300 Feb-04


what I want is a macro to write "Unique" in the third column if " ID " is
there only once in a month. and in case its there more than once in the

same
month. only one "Unique" in the third column


any help apprecaited







  #6   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Duplicates

You could try this but it is likely very similar

=IF(SUM(($A$2:A2=A2)*($B$2:B2=B2))1,"","Unique")

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"flow23" wrote in message
...
Thanks It works great.
I also added few more arrays to it and incorporated it into a macro.

but the problem is speed.
there are 12000 records

anyway to do it quicker?

"Bob Phillips" wrote:

Pt this in C2 and copy down

=IF(SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2=B2))1,"","Unique")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"flow23" wrote in message
...
I have two columns..

ID MONTH
100 Jan-04 Unique
200 Jan-04 Unique
200 Jan-04
300 Feb-04 Unique
300 Feb-04
300 Feb-04


what I want is a macro to write "Unique" in the third column if " ID

" is
there only once in a month. and in case its there more than once in

the
same
month. only one "Unique" in the third column


any help apprecaited







  #7   Report Post  
Posted to microsoft.public.excel.misc
John James
 
Posts: n/a
Default Duplicates


Hi flow23,

To solve the speed issue, eliminate as many arrays as possible. They
are notoriously slow for large spreadsheets. e.g. Try entering the
formula I'd suggested as they are not arrays.


--
John James
------------------------------------------------------------------------
John James's Profile: http://www.excelforum.com/member.php...o&userid=32690
View this thread: http://www.excelforum.com/showthread...hreadid=531468

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
Checking for duplicates - think this is simple [email protected] Excel Discussion (Misc queries) 9 February 27th 06 09:32 PM
i need to find duplicates! ASAP mj Excel Worksheet Functions 4 February 25th 06 12:50 AM
Marking Duplicates Daniell Excel Worksheet Functions 1 May 26th 05 10:53 PM
Duplicates Alex Excel Discussion (Misc queries) 0 May 20th 05 07:22 PM
Finding Duplicates nospaminlich Excel Worksheet Functions 4 February 5th 05 11:57 PM


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