View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Looking for a function that will count the first instance of a

What you want to do is count the unique items. Try this:

=SUMPRODUCT((A1:A100<"")/COUNTIF(A1:A100,A1:A100&""))

--
Biff
Microsoft Excel MVP


"ibvalentine" wrote in message
...
I have a column in a list that contains types of expenses. I want to count
how many different types of expenses I have. In other words, if one of the
expense types is "office" and there are several instances of "office", I
just
want to count "office" once. If "fees" is in the column several times, I
just
want to count fees once and so on.

The way I do it now is to use the Subtotal feature to group the expenses,
and then click on the level 2 button. The level 2 subtotals will return
just
one instance of each type. I then copy them and use paste special to paste
the values in cells off to the side. I can then use the count function to
count each type of expense.

So I am wondering if there is a better way or if there is a function that
will count just one instance of a group within a field.