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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

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"))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,488
Messages
5,770,380
Members
425,613
Latest member
martinijr

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