# Count cells by colour and category

1. ## Count cells by colour and category

So, I have seen many examples around and about where people have counted cells by colour, but I am yet to see one which does colour and category.

Column B has options of 'Biology', 'Chemistry' and 'Physics'. Column D has 'Your Answer', and Column E has 'Correct Answer'. There are 110 numbers (relating to test questions) down column A.

What I am trying to achieve is a cell which counts how many Biology answers are correct. Seems like it should be super easy, just maybe I'm having a slow day.

I imagine the excel-pseudo-code would looks something like:

=COUNTIFS(B3:B112, "Biology", D3:D112, \$D3 = \$E3)

or..

=COUNT(B3:B112, AND(\$B3 = "Biology", \$D3 = \$E3))

As I'm sure is moderately obvious, I'm not too sure how to just 'check a column', hence all the "\$D3" stuff. The cells in Column D are conditionally formatted to be green or red, depending on "Your Answer" vs. "Correct Answer", hence I was also wondering if it is maybe easier to work it out by colour and category.

The above count info would go into a cell in another table, so the percentage per subject could be worked out as data is entered. Ideally.

Thank you.

2. ## Re: Count cells by colour and category

I don't believe you need VBA at all. Try this in H3:

and this in M3:

Welcome to the forum!

3. ## Re: Count cells by colour and category

You're fantastic!! Worked first time. Thank you very much for your help.

4. ## Re: Count cells by colour and category

You are welcome!

5. ## Re: Count cells by colour and category

For the benefit of others, I am attaching the workbook. Please don't remove important bits of the thread - you are rendering it less use to those who might find it useful later. Thanks for your co-operation.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1