ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Counting unique values (https://www.excelbanter.com/excel-worksheet-functions/198839-counting-unique-values.html)

blswes

Counting unique values
 
Trying to count how many customers there were in 2006 only vs. 2007 only vs.
2006 & 2007.

Data's set up with Customer ID and Year columns, so if a customer is part of
both 2006 and 2007, then there would be two separate rows (one for each year).

Any suggestions?

Roger Govier[_3_]

Counting unique values
 
Hi

=SUMPRODUCT(--(A1:A1000),--(B1:B1000) ) for 2006
=SUMPRODUCT(--(A1:A1000),--(C1:C1000)) for 2007
=SUMPRODUCT(--(A1:A1000),--(B1:B1000),--(C1:C1000)) for both years
--
Regards
Roger Govier

"blswes" wrote in message
...
Trying to count how many customers there were in 2006 only vs. 2007 only
vs.
2006 & 2007.

Data's set up with Customer ID and Year columns, so if a customer is part
of
both 2006 and 2007, then there would be two separate rows (one for each
year).

Any suggestions?



[email protected]

Counting unique values
 
On Aug 14, 9:30*am, blswes wrote:
Trying to count how many customers there were in 2006 only vs. 2007 only vs.
2006 & 2007.

Data's set up with Customer ID and Year columns, so if a customer is part of
both 2006 and 2007, then there would be two separate rows (one for each year).

Any suggestions?


Use the Count function

=COUNT(C1:C2) - based of a sort of 2006 C1:C2 = Cell Range
=COUNT(C1:C2) - based of a sort of 2007 C1:C2 = Cell Range
=COUNT(C1:C2) - based of a sort of 2006 & 2007 C1:C2 = Cell Range



blswes

Counting unique values
 
I think I may have described the situation too vaguely.

In column A (let's say), I have Customer IDs. And in column B, I have Year
(either 2006 or 2007).

Therefore, a Customer ID that's in both 2006 and 2007 ends up with an entry
in two rows (one for 2006 and one for 2007).

How do I count how many Customer IDs show up for only 2006 vs. only 2007 vs.
both 2006 and 2007?

"Roger Govier" wrote:

Hi

=SUMPRODUCT(--(A1:A1000),--(B1:B1000) ) for 2006
=SUMPRODUCT(--(A1:A1000),--(C1:C1000)) for 2007
=SUMPRODUCT(--(A1:A1000),--(B1:B1000),--(C1:C1000)) for both years
--
Regards
Roger Govier

"blswes" wrote in message
...
Trying to count how many customers there were in 2006 only vs. 2007 only
vs.
2006 & 2007.

Data's set up with Customer ID and Year columns, so if a customer is part
of
both 2006 and 2007, then there would be two separate rows (one for each
year).

Any suggestions?



Roger Govier[_3_]

Counting unique values
 
Hi

Since the Year is held in column B, (I had thought one year was in B and 1
in C), then use
=SUMPRODUCT(--(A1:A1000),--(B1:B1000=2006) ) for 2006
=SUMPRODUCT(--(A1:A1000),--(B1:B1000)=2007 ) for 2007
=SUMPRODUCT(--(A1:A1000)*(B1:B1000=2006)+(B1:B1000=2007)) for 2006&2007
--
Regards
Roger Govier

"blswes" wrote in message
...
I think I may have described the situation too vaguely.

In column A (let's say), I have Customer IDs. And in column B, I have Year
(either 2006 or 2007).

Therefore, a Customer ID that's in both 2006 and 2007 ends up with an
entry
in two rows (one for 2006 and one for 2007).

How do I count how many Customer IDs show up for only 2006 vs. only 2007
vs.
both 2006 and 2007?

"Roger Govier" wrote:

Hi

=SUMPRODUCT(--(A1:A1000),--(B1:B1000) ) for 2006
=SUMPRODUCT(--(A1:A1000),--(C1:C1000)) for 2007
=SUMPRODUCT(--(A1:A1000),--(B1:B1000),--(C1:C1000)) for both years
--
Regards
Roger Govier

"blswes" wrote in message
...
Trying to count how many customers there were in 2006 only vs. 2007
only
vs.
2006 & 2007.

Data's set up with Customer ID and Year columns, so if a customer is
part
of
both 2006 and 2007, then there would be two separate rows (one for each
year).

Any suggestions?




All times are GMT +1. The time now is 07:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com