View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Steve Newhouse
 
Posts: n/a
Default Count rows with specific attributes in VBA

The "Count Unique Text Elements" solution proposed by Microsoft....

"=SUM(IF(FREQUENCY(MATCH(A1:A10,A1:A10,0),MATCH(A1 :A10,A1:A10,0))0,1))"

.... has a problem. It counts ONLY items that occur no more than once.
I want to count each item, but only the first occurrence. So if there
are three "X" values, I still want to count 1 of them, not 0, and for
that first one, fall through to the next conditional test in the
formula (joined by +, *, etc as is the custome w/array formulas). The
other problem is that the above code appears to return an array of the
size of the range + 1, which is annoying and means that subsequent
conditional tests have to use A1:A11 to prevent error...