CountIfs using or statement, not duplicating counts

soozler

New Member
Joined
May 10, 2012
Messages
3
The Spreadsheet:

NameSausagePepperoniCheese
Joexxx
Frank
Benx
Kevin
Collinxx

<tbody>
</tbody>

The Problem:

I need to count how many people have at least 1 "x" in a column. The formula should return "3".

If a person has no X in the Sausage, Pepperoni, or Cheese column they are not counted.


Solutions: ?
 

Some videos you may like

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,414
Assuming data in A1:D6 (headers in row 1), maybe

=SUMPRODUCT(--(COUNTIF(OFFSET($B$2:$D$6,ROW($B$2:$D$6)-ROW($B$2),0,1),"x")>0))

M.
 

Jeff Meyers

Active Member
Joined
Mar 14, 2012
Messages
405
Here's another approach. Note that any character in the sausage / pepperoni / cheese columns will suffice for this approach (not just x's).

Sheet1
ABCD
1NameSausagePepperoniCheese
2Joexxx
3Frank
4Benx
5Kevin
6Collinxx
7
8
9----------------------------------------------------------------
10
113
12

<thead>
</thead><tbody>
</tbody>
Excel 2010

Worksheet Formulas
CellFormula
A11=SUMPRODUCT((A2:A6<>"")*(B2:B6&C2:C6&D2:D6<>""))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 

T. Valko

Well-known Member
Joined
May 9, 2009
Messages
16,623
The Spreadsheet:

Name
Sausage
Pepperoni
Cheese
Joe
x
x
x
Frank
Ben
x
Kevin
Collin
x
x

<TBODY>
</TBODY>

The Problem:

I need to count how many people have at least 1 "x" in a column. The formula should return "3".

If a person has no X in the Sausage, Pepperoni, or Cheese column they are not counted.


Solutions: ?
Try this...

=SUMPRODUCT(--(MMULT(--(B2:D6="x"),{1;1;1})>0))

The array constant {1;1;1} represents the number of columns in the range of interest.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,320
Messages
5,600,946
Members
414,417
Latest member
Nobu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top