Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Counting Unique Pairs of Cells

I am trying to count unique pairs of cells in different columns. For
instance, I have:

"A" "C"
1 apples
2 oranges
2 oranges
2 oranges
3 bananas
4 oranges
4 oranges
5 apples
oranges
6
7 apples
7 apples

I am trying to count the total number of unique pairs of cells that have
particular (non-blank) entry in the second column AND a nonzero corresponding
value in the first (for example, for "oranges" I would like to end up with a
count of 2; for "apples" - with 3, and a total count of 6)

Thank you very much in advance - I appreciate it!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Counting Unique Pairs of Cells

In D1, enter:

=A1 & C1 and copy down

and then count uniques in column D:

http://www.cpearson.com/excel/Duplicates.aspx
--
Gary''s Student - gsnu200792


"Makaron" wrote:

I am trying to count unique pairs of cells in different columns. For
instance, I have:

"A" "C"
1 apples
2 oranges
2 oranges
2 oranges
3 bananas
4 oranges
4 oranges
5 apples
oranges
6
7 apples
7 apples

I am trying to count the total number of unique pairs of cells that have
particular (non-blank) entry in the second column AND a nonzero corresponding
value in the first (for example, for "oranges" I would like to end up with a
count of 2; for "apples" - with 3, and a total count of 6)

Thank you very much in advance - I appreciate it!

  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Counting Unique Pairs of Cells

Another straightforward play which gets you there ..

Assume data as posted in cols A and C, from row2 down

In D2, copied down:
=IF(SUMPRODUCT((A$2:A2<"")*(C$2:C2<"")*(A$2:A2=A 2)*(C$2:C2=C2))1,"",SUMPRODUCT((A$2:A2<"")*(C$2: C2<"")*(A$2:A2=A2)*(C$2:C2=C2)))

Then, assuming you have listed the unique fruits:
apples, oranges, bananas
in F2:F4

Simply, place in G2, copy down: =SUMIF(B:B,E2,C:C)
will return the required figs for each fruit
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Makaron" wrote:
I am trying to count unique pairs of cells in different columns. For
instance, I have:

"A" "C"
1 apples
2 oranges
2 oranges
2 oranges
3 bananas
4 oranges
4 oranges
5 apples
oranges
6
7 apples
7 apples

I am trying to count the total number of unique pairs of cells that have
particular (non-blank) entry in the second column AND a nonzero corresponding
value in the first (for example, for "oranges" I would like to end up with a
count of 2; for "apples" - with 3, and a total count of 6)

Thank you very much in advance - I appreciate it!

  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Counting Unique Pairs of Cells

Errata, line below should have read as:
Simply, place in G2, copy down: =SUMIF(C:C,F2,D:D)

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Unique Pairs of Cells

Try this array formula** :

=COUNT(1/FREQUENCY(IF((A2:A13<"")*(C2:C13<""),MATCH(A2:A1 3&C2:C13,A2:A13&C2:C13,0)),ROW(A2:A13)-MIN(ROW(A2:A13))+1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"Makaron" wrote in message
...
I am trying to count unique pairs of cells in different columns. For
instance, I have:

"A" "C"
1 apples
2 oranges
2 oranges
2 oranges
3 bananas
4 oranges
4 oranges
5 apples
oranges
6
7 apples
7 apples

I am trying to count the total number of unique pairs of cells that have
particular (non-blank) entry in the second column AND a nonzero
corresponding
value in the first (for example, for "oranges" I would like to end up with
a
count of 2; for "apples" - with 3, and a total count of 6)

Thank you very much in advance - I appreciate it!





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Counting Unique Pairs of Cells

Thank you very much - great job!

"Max" wrote:

Errata, line below should have read as:
Simply, place in G2, copy down: =SUMIF(C:C,F2,D:D)

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

  #7   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Counting Unique Pairs of Cells

welcome, glad it worked for you
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Makaron" wrote in message
...
Thank you very much - great job!



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
Counting pairs Piotrek Excel Worksheet Functions 8 August 21st 07 09:32 PM
Counting for unique values using 2 cells Keith Excel Worksheet Functions 6 July 3rd 07 06:14 PM
Counting only Unique cells Bob Excel Worksheet Functions 11 June 9th 06 06:19 PM
Unique records of matching pairs pmarques Excel Worksheet Functions 0 October 25th 05 05:23 PM
Counting Match Pairs In Rows bmb2200 Excel Worksheet Functions 4 August 25th 05 03:35 AM


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