View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default counting x instances of a string across columns...

Try this:

=SUMPRODUCT(--(MMULT(--(A1:D4="yes"),{1;1;1;1})=n))

Where n = 1, 2 or 3 (or whatever)

Note: this will work if you have no more than 5460 rows of data.

--
Biff
Microsoft Excel MVP


wrote in message
ps.com...


A B C D
Yes No Yes Yes
No No No Yes
No Yes Yes No
Yes Yes No No


What I'm trying to do is count the cases where there is one "Yes" (or
maybe 2 or 3 yeses) in any of the columns, with one formula for the
entire array. So to count rows with one yes, there would be 1. With 3
yeses, there would be 1 row. With 2 yeses, there would be 2 rows.

Can't figure out how to do this without using a helper column, any
help is appreciated..