Count cells that match?

meredithsegal

New Member
Joined
Oct 10, 2011
Messages
38
I have data in C2:C14 and D2:D14. I want Excel to count the number of instances in which the value in column C matches the value in that row in column D. What's the easiest way?

Thanks so much--you guys are always awesome!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Awesome, why does it work tho?

Because I told it to.:LOL:


It creates an array of True or False results based on the expression C2:C14=D2:D14.
Evaluating each row 1 at a time, does C2 = D2 ? Does C3 = D3?
With a True or False result for each row

The -- converts those True/False results into 1/0 results (True = 1, False = 0)
Then it sums the results.
 
Upvote 0
(and how can I amend it only to consider cells with a given value in column A -- how to add (countif(A2:A14,"apple"))
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,749
Members
449,050
Latest member
excelknuckles

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