COUNT column matching criteria

JamesWayne

New Member
Joined
Sep 6, 2017
Messages
15
Hi All, I've been trying to work out a formula that will count a column if the criteria is matched and I've using SUMPRODUCT, COUNTIF functions without much success.

What I'm after is if range A1:A3 matches cell D1 then COUNTA column B is basically what I need to work. I don't want column A to be counted, column A is just the criteria to work out what in column B to count.

Answer below should be 2 (no sum, just count), thank you.

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Car 1[/TD]
[TD]11[/TD]
[TD][/TD]
[TD]Car1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Car 2[/TD]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Car 1[/TD]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Hi Aladin

If I'm not mistaken the first one will only discard empty B cells, null strings in B will be counted.

You are not mistaken. I should have added to [1] and [2/3] are equivalent if the B-range does not house any formulas. Otherwise, [2] would be the formula to use.
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,223,910
Messages
6,175,320
Members
452,635
Latest member
laura12345

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
Back
Top