Count If Two Columns Contain Specific Data

davidlachnicht

New Member
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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Brian from Maui

MrExcel MVP
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"))

Replies
6
Views
133
Replies
5
Views
549
Replies
1
Views
266
Replies
6
Views
621
Replies
7
Views
447

1,181,751
Messages
5,931,807
Members
436,805
Latest member
waseem abbas

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.

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

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