# Sumproduct to Count Rows Meeting Multiple AND/OR Criteria - is there a Better/Easier Way?

#### AnyaK

##### New Member
Hello,

I have one column, AH, with names of different departments of our organisation.

Columns C,D and F contain health information as to whether or not clients are disabled.

I want to count how many clients of 3 of our departments have either "No" entered into either or all rows within C,D and F, or for whom their rows in C,D, and F are blank. I've tried so many variations of:

=SUMPRODUCT(--(--MMULT(ISNUMBER(SEARCH({"*ProjectChocolate*","*ProjectCarrot*","*Project Pecan*"},AH2:AH3000)),{1;1;1})>0)*((ISBLANK(C2:C3000))+(D2:D3000="No")+(ISBLANK(D2:D3000))+(F2:F3000="No")+(ISBLANK(F2:F3000))))

With this formula, I get a "VALUE" error.

Some other variations gave a resulting number which was 3 times the total number of clients in these projects, so clearly that was wrong too.

I'd really be so very grateful for any help as I'm literally in tears.

Thanks,

AnyaK

### Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

#### Marcelo Branco

##### MrExcel MVP
I would use a Helper column

See if this example helps - to make things easier i used column A (Project) instead of column AH (adjust to suit)

 A​ B​ C​ D​ E​ F​ G​ H​ I​ J​ K​ 1​ Project​ Value1​ Value2​ Value3​ Search​ Result​ Helper​ 2​ xxx ProjectChocolate​ No​ ProjectChocolate​ 4​ 1​ 3​ zzzz​ No​ ProjectCarrot​ 4​ ProjectCarrot xyz​ Project Pecan​ 1​ 5​ Project Pecan www​ Yes​ No​ 1​ 6​ zzzz​ 7​ ProjectChocolate​ No​ No​ No​ 1​ 8​ ProjectCarrot xyz​ Yes​

<tbody>
</tbody>

Search list in H2:H4

Helper column
Formula in K2 copied down
=IF(SUMPRODUCT(--ISNUMBER(SEARCH(H\$2:H\$4,A2)))=0,"",IF(COUNTIF(C2:D2,"No")+(F2="No")+(COUNTIF(C2:D2,"")+(F2="")=3),1,""))

I2
=SUM(K2:K7)

M.

Last edited:

#### AnyaK

##### New Member
Hi Marcelo,

I just wanted to say a huge thank you for your help. This worked perfectly.

Apologies for the delayed reply, I've been unwell, so was offline for a time.

Thanks again,

AnyaK

1,089,429
Messages
5,408,172
Members
403,188
Latest member
Sanjana Ramesh