##### Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

# COUNTING OCCURENCES

0

Hi I need help. What formulae can to pick from data from table A and count how many times each header in table B appear for each team in the first column of table B. 1 being home win X being draw and 2 being away win

### Discussion

Kimchoj,

Have you tried my solution? Does it solve things for you?
Please comment.
WillieD24 (rep: 587) Apr 7, '24 at 9:53 pm
@Kimchoj,

As per the rules of the forum: "When you get Answers to your Question you must reply or select the best one"
People like John and myself provide help without compensation and in our spare time.
If you do not select or comment on my answer, don't be surprised if when you post a question in the future that you don't get any help.
WillieD24 (rep: 587) Apr 12, '24 at 1:55 pm

## Answers

0

Hi Kimchoj and welcome to the forum,

Using your sample file, in cell "I5" I put the formula "=COUNTIFS((\$D\$4:\$D\$19),H5,\$E\$4:\$E\$19,"1")"; in cell "J5" I put the formula "=COUNTIFS((\$D\$4:\$D\$19),H5,\$E\$4:\$E\$19,"X")"; and in cell "K5" I put the formula "=COUNTIFS((\$D\$4:\$D\$19),H5,\$E\$4:\$E\$19,"2")"; and then copied them down to row 19. The teams after "A. Sanluqueno" (rows 8-19) show zeros because they are not in Col D.

How this works: (Cell I5) - the first part of the formula looks in Col D for the team in Col H, then in Col E count the number of times "1" is entered.

In the attached file you can see the result.

If this solves things for you please mark my answer as Selected.

Cheers   :-)