Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mparekh
 
Posts: n/a
Default count duplicate records in a group


Here's the set of data I am struggling with:

Column A Column B
12345 1
12345 2
12345 3
12345 1
12345 2
12345 3
12346 1
12346 2
12346 1
12346 2

Am trying to write a formula that would count duplicate records in
column B for the group of records in Column A. For e.g. for record
12345 in column A, 1 in column B gets repeated twice and so on and so
forth or in other words, for record 12345 in column A, group 1,2,3 in
column B gets repeated twice.

Is there a formula that would help me derive that? Pleasseee help, have
been struggling with this since last two days and finally need to pick
your excel brains on this.

Thank You.
Parekh


--
Mparekh
------------------------------------------------------------------------
Mparekh's Profile: http://www.excelforum.com/member.php...o&userid=14999
View this thread: http://www.excelforum.com/showthread...hreadid=495089

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ashish Mathur
 
Posts: n/a
Default count duplicate records in a group

Hi,

You may try the following array formula (Ctrl+Shift+Enter). the data is in
the format below (in range A1:B7)

12345 1
12345 2
12345 3
12345 1
12345 2
12345 3
12345 1

In A9 enter, 12345 and in B9 enter 1. in C9, enter the following array
formula COUNT(IF(($A$1:$A$7=A9)*($B$1:$B$7=B9),B1:B7))

You may chage the value in B9 to 2 or 3.

Regards,



"Mparekh" wrote:


Here's the set of data I am struggling with:

Column A Column B
12345 1
12345 2
12345 3
12345 1
12345 2
12345 3
12346 1
12346 2
12346 1
12346 2

Am trying to write a formula that would count duplicate records in
column B for the group of records in Column A. For e.g. for record
12345 in column A, 1 in column B gets repeated twice and so on and so
forth or in other words, for record 12345 in column A, group 1,2,3 in
column B gets repeated twice.

Is there a formula that would help me derive that? Pleasseee help, have
been struggling with this since last two days and finally need to pick
your excel brains on this.

Thank You.
Parekh


--
Mparekh
------------------------------------------------------------------------
Mparekh's Profile: http://www.excelforum.com/member.php...o&userid=14999
View this thread: http://www.excelforum.com/showthread...hreadid=495089


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
wjohnson
 
Posts: n/a
Default count duplicate records in a group


If you want something that looks like the following:

Count of Part B Part B
Part A 1 2 3 (blank) Grand Total
12345 2 2 2 6
12346 2 2 4
(blank)
Grand Total 4 4 2 10

I put Part A at the top of Column A, Part B at the top of Column.
You can do this very easily in a PIVOT table.
I put part A as the row info. Part B as the column and data field.
Try it a couple of different ways to experiment with how you want to
see the info.


--
wjohnson
------------------------------------------------------------------------
wjohnson's Profile: http://www.excelforum.com/member.php...o&userid=29640
View this thread: http://www.excelforum.com/showthread...hreadid=495089

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mparekh
 
Posts: n/a
Default count duplicate records in a group


Ashish, Thank you for the formula. The problem I am facing is, Column A
has various groups of data against which Column B has sub groups of
data, as I had listed earlier. So it would not be possible for me to
enter 12345 in A9 and 1 in B9. That was just an example to be more
explicit on what I am trying to do. I would need an array formula which
would look at data in Column A then recurring data sub groups in Column
B and count those sub groups in Column B and display the result in
Column C.

Pivot tables would not help me much at this point as I need to use the
data in Column C for further calculations in the spreadsheet.

Thank you in advance.


--
Mparekh
------------------------------------------------------------------------
Mparekh's Profile: http://www.excelforum.com/member.php...o&userid=14999
View this thread: http://www.excelforum.com/showthread...hreadid=495089

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mparekh
 
Posts: n/a
Default count duplicate records in a group


Ashish, Thanks! I modified your suggested formula a bit and it worked.

Thanks again.


--
Mparekh
------------------------------------------------------------------------
Mparekh's Profile: http://www.excelforum.com/member.php...o&userid=14999
View this thread: http://www.excelforum.com/showthread...hreadid=495089

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
Filter Count of Records Retrieved. amkazen Excel Discussion (Misc queries) 2 March 31st 05 10:03 PM
count a group of numbers but do not count duplicates Lisaml Excel Worksheet Functions 2 January 26th 05 11:19 PM
Subtotal of Subtotal displays Grand Total in wrong row Thomas Born Excel Worksheet Functions 5 January 6th 05 01:46 PM
Duplicate records in Excel Sheidsa Excel Discussion (Misc queries) 1 November 30th 04 12:23 AM
Group by count formula nobrabbit Excel Worksheet Functions 1 November 7th 04 09:10 PM


All times are GMT +1. The time now is 06:17 AM.

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"