#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 149
Default Writing a query

Hi all.

I'm having a 'mare trying to write a query that will mark duplicates as
duplicates and triplicates as triplicates in a sorted column - see below

30460508
30460508
30460509
30460509
30460512
30460512
30460512
30460514
30460514
30460514
30460516
30460516
30460516
30460520
30460520
30460520
30460522
30460522
30460522
30460524
30460524


Say this is Cl A - what I want as output in Col B is 2 against the
duplicates and 3 against the triplicates.......

Any help gratefully recied.

Cheers
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Writing a query

Perhaps this formula coppied down...

=IF(COUNTIF(A:A, A1)=1, "", COUNTIF(A:A, A1))
--
HTH...

Jim Thomlinson


"Pierre" wrote:

Hi all.

I'm having a 'mare trying to write a query that will mark duplicates as
duplicates and triplicates as triplicates in a sorted column - see below

30460508
30460508
30460509
30460509
30460512
30460512
30460512
30460514
30460514
30460514
30460516
30460516
30460516
30460520
30460520
30460520
30460522
30460522
30460522
30460524
30460524


Say this is Cl A - what I want as output in Col B is 2 against the
duplicates and 3 against the triplicates.......

Any help gratefully recied.

Cheers

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Writing a query

Try the following formula in cell B1, copied down.

=IF(COUNTIF($A$1:$A$10,A1)=2,2,IF(COUNTIF($A$1:$A$ 10,A1)=3,3,""))

It will return 2 or 3 if a value in A1 occurs two or three times in
A1:A10. Otherwise, it returns an empty string. You can adapt it to
display whatever counts you need.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]



On Thu, 28 Jan 2010 13:45:01 -0800, Pierre
wrote:

Hi all.

I'm having a 'mare trying to write a query that will mark duplicates as
duplicates and triplicates as triplicates in a sorted column - see below

30460508
30460508
30460509
30460509
30460512
30460512
30460512
30460514
30460514
30460514
30460516
30460516
30460516
30460520
30460520
30460520
30460522
30460522
30460522
30460524
30460524


Say this is Cl A - what I want as output in Col B is 2 against the
duplicates and 3 against the triplicates.......

Any help gratefully recied.

Cheers

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
Import New Database Query (Union Query) in Spreadsheet klock Excel Discussion (Misc queries) 2 September 24th 09 02:30 AM
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 10:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 07:53 PM
Microsoft Query rejects "nz" function in Access Query Vaughan Excel Discussion (Misc queries) 0 May 4th 05 06:20 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 08:54 PM


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