Count If Two Columns Contain Specific Data

davidlachnicht

New Member
Joined
May 10, 2004
Messages
26
Accoridng to Microsoft Excel Help, the following formula should work:

=SUM(IF(B5:B25="Northwind",IF(C5:C25="Western",1,0)))

This should report the number of occurances where a row contains Northwind in column B -and- Western in column C.

I tried it exactly - it doesn't work.

Cut and paste from Excel Help:

>> Count the occurrences of multiple conditions
>> In the following formula, whenever Excel finds "Northwind" in the range
>> B5:B25, it then checks for the text "Western" in the same row in
>> column C (the range C5:C25). Excel then calculates the number of
>> rows that contain both.
>>
>> =SUM(IF(B5:B25="Northwind",IF(C5:C25="Western",1,0)))
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Brian from Maui

MrExcel MVP
Joined
Feb 16, 2002
Messages
8,459
davidlachnicht said:
Accoridng to Microsoft Excel Help, the following formula should work:

=SUM(IF(B5:B25="Northwind",IF(C5:C25="Western",1,0)))

This should report the number of occurances where a row contains Northwind in column B -and- Western in column C.

I tried it exactly - it doesn't work.

Cut and paste from Excel Help:

>> Count the occurrences of multiple conditions
>> In the following formula, whenever Excel finds "Northwind" in the range
>> B5:B25, it then checks for the text "Western" in the same row in
>> column C (the range C5:C25). Excel then calculates the number of
>> rows that contain both.
>>
>> =SUM(IF(B5:B25="Northwind",IF(C5:C25="Western",1,0)))

The formula should be entered as an arrary...CTRL+SHIFT+ENTER.

A non array

=SUMPRODUCT(--(B5:B25="Northwind"),--(C5:C25="Western"))
 

Forum statistics

Threads
1,147,623
Messages
5,742,208
Members
423,712
Latest member
edzubur

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