COUNTIF using multiple columns if one meets the criterion

Airfix9

Well-known Member
Joined
Sep 23, 2005
Messages
886
Hi all,

Having a senior moment.

What I have is a list of outlets in column A and then, in columns B, C and D a 1 if they stock a particular model (one column for each model).

What I want to do is to count the number of times that an outlet stocks at least one of the models. That is to say, if the sum of columns B, C and D is 1 or more, count it.

Ideas greatly received.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try:

=SUMPRODUCT(--((B1:B100+C1:C100+D1:D100)>=1))
 
Upvote 0
Thanks guys. I adapted Mr Kowz's formula as follows:

=SUMPRODUCT(--((INDIRECT("'"&A9&"'!B3:B1000")+INDIRECT("'"&A9&"'!C3:C1000")+INDIRECT("'"&A9&"'!D3:D1000"))>=1)*--(INDIRECT("'"&A9&"'!A3:A1000")<>""))

Where A9 contains the country name of the sheet I am looking at and I then used the final look at column A to avoid the totals (the number of rows could change but would never be more than 1000).

Thanks for your swift help.
 
Upvote 0
Your formula should work OK as it is...... but note that it's bad practice to use *-- in any formula

Either use a syntax like

=SUMPRODUCT((A2:A10="x")*(B2:B10="y"))

or

=SUMPRODUCT(--(A2:A10="x"),--(B2:B10="y"))
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

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
Back
Top