using the AND and the COUNT?

mark gardner

Board Regular
Joined
Sep 6, 2006
Messages
52
if I have one column (a1:a10) with either an A or B in the cells and a second column (b1:b10) with either a C or a D in the cells, what would be my function that would check the 2 columns and return a value that represented how many rows had a specific combination such as A & C side by side in them? I am stuck.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
=SUMPRODUCT(--(A1:A10="A"),--(B1:B10="C"))

IMPORTANT RULES
Ranges cannot be entire column refs like A:A, must specify row #s like A1:A100
Ranges must be same size
you can use Cell Refs for the variables like:

=SUMPRODUCT(--(A1:A10=C1),--(B1:B10=D1))

C1=A
D1=C

Hope this helps...
 
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,167,974
Messages
5,856,600
Members
431,823
Latest member
irtezazaz

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