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

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
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,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.
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