Count text in Column B based on criteria in Column A?

resrzfl

New Member
Joined
May 3, 2012
Messages
3
I have attempted to research this issue on Google but I can't seem to word the issue properly and therefore unable to find an answer - even in this forum.

THE SETUP: I have a list of places in Column A. Each place may appear multiple times depending on Column B. Column B contains text titles of events which occurred at each place. These titles are repetitive, sometimes multiple times for each place listed in Column A. If I have been unclear, here is a crude example:

Place Event
A 1
A 1
A 1
A 2
A 2
A 3
B 1
B 2
B 2
B 2
C 1
D 3
D 3

THE GOAL: I need to count how many times an event title may appear for each individual place in Column A. As seen above, "2" appears twice for "A", three times for "B", and not at all for "C" and "D".

Can anyone assist?

Thank you in advance.

:confused:
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Welcome to MrExcel.

Example:

=SUMPRODUCT(--(A2:A14="A"),--(B2:B14=1))

You can use cell references in place of "A" and 1.
 
Upvote 0
Here's an approach with an table summarizing the results:

Excel Workbook
ABCDEFGH
1PlaceEvent
2A1
3A1
4A1
5A2
6A2
7A3
8B1
9B2
10B2
11B2
12C1
13D3
14D3
15
16Place
17EventABCD
181311-
19223--
2031--2
21
22
23------------------------------------------------------------------------
24
Sheet2
Excel 2010
Cell Formulas
RangeFormula
E18=SUMPRODUCT(--($A$2:$A$14=E$17),--($B$2:$B$14=$D18))
E19=SUMPRODUCT(--($A$2:$A$14=E$17),--($B$2:$B$14=$D19))
E20=SUMPRODUCT(--($A$2:$A$14=E$17),--($B$2:$B$14=$D20))
F18=SUMPRODUCT(--($A$2:$A$14=F$17),--($B$2:$B$14=$D18))
F19=SUMPRODUCT(--($A$2:$A$14=F$17),--($B$2:$B$14=$D19))
F20=SUMPRODUCT(--($A$2:$A$14=F$17),--($B$2:$B$14=$D20))
G18=SUMPRODUCT(--($A$2:$A$14=G$17),--($B$2:$B$14=$D18))
G19=SUMPRODUCT(--($A$2:$A$14=G$17),--($B$2:$B$14=$D19))
G20=SUMPRODUCT(--($A$2:$A$14=G$17),--($B$2:$B$14=$D20))
H18=SUMPRODUCT(--($A$2:$A$14=H$17),--($B$2:$B$14=$D18))
H19=SUMPRODUCT(--($A$2:$A$14=H$17),--($B$2:$B$14=$D19))
H20=SUMPRODUCT(--($A$2:$A$14=H$17),--($B$2:$B$14=$D20))
 
Upvote 0
Thanks for the reply, I will check it out.

I just realized there is one more component which has had me scratching my head.

There is a 3rd Column which contains each "Event"'s associated Date. I do not need to identify every date, however, I do need to match the number of times an Event has occurred for each location (which you have tackled) within a given year.

Any ideas?

Thank you again.
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

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