On Tue, 28 Jun 2005 07:39:10 -0700, "Michael"
<Michael@discussions.microsoft.com> wrote:

>If my data contains like "P1-C40XXX", and i want to include it in the
>counting. How to achieve it?


Try the array formula:

=SUM(IF(FREQUENCY(IF((A1:A10<>"")*((B1:B10="P1")+
(LEFT(B1:B10,6)="P1-C40")),MATCH(A1:A10,A1:A10,0)),
ROW(INDIRECT("1:"&ROWS(A1:A10))))>0,1))


--ron