View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tree Tree is offline
external usenet poster
 
Posts: 41
Default count values in a column, but. . .

I stumbled on a solution, but it's sort of clunky.

I created a pivot table with the NAME field in the rows and TOWN in columns,
with TOWN in the data section. The pivot table very nicely counted the
number of times each person was associated with a particular town and very
nicely totaled this up - which is exactly what I didn't want.

But then I inserted a new row of cells at the very bottom of the pivot
table, and used the COUNT function in each cell below each TOWN column. Of
course, the range of each COUNT formula only included cells in the data
portion of the pivot table, immediately above.

This worked, but there must be a simpler, more elegant way. If anyone
knows, I'd sure appreciate your sharing.

Thanks.




"tree" wrote:

Sorry - again - that when I posted my question, the space between the
imaginary columns in my imaginary tables were deleted. Hope it makes sense.

"tree" wrote:

First, apologies: My question must be answered in this and countless other
forums, but I can scarcely even begin to 'formulate' my question in search
syntax. So here goes.

I have a table with the columns Name (of people) and Town. (There are other
columns, but these are the two I'm concerned with.) I want to count the
number of people there are for each Town, but count each person only once.

For instance -

NAME TOWN
person1 town1
person1 town1
person2 town1
person3 town2
person3 town2
person4 town3


The results I'm looking for would be -

TOWN COUNT (of individual people)
town1 2
town2 1
town3 1

Thanks.