Using COUNTIFS to count cell color?

Is it possible to write a formula that will count the number of cells in a row or column that are the same color (ex. all green) cells?

I have the cells set to be green if my students got the right answer, and red if they got it wrong. I'd like to create totals of all of the correct answers in each row (which would be per student on a test), and all of the correct answers in each row (which would be all of the students who obtained the correct answer on each question).

Any ideas?

Thanks.
Laura

MacBook 2.2 GHz Intel Core 2 Duo, 4 GB 667 MHz DDR2 SDRAM, Mac OS X (10.5.8)

Posted on Dec 16, 2010 8:39 AM

Reply
10 replies

Dec 16, 2010 9:53 AM in response to Jerrold Green1

Thanks, Jerry, for responding so quickly.

That's what I thought of doing first, actually -- but since each question has a different answer, it seems labor-intense to do this every time I log my grades.

I was hoping I could just assign a green=true kind of condition, I guess. That way, the formula would work with every test I used that type of table for.

Laura

Dec 17, 2010 7:17 AM in response to KOENIG Yvan

Thanks, Jerry and Yvan.

Yvan, I'm not sure how to use a numerical value to define a color. Do you mean in with a conditional format rule? I think that's what I'm doing now, except I am using a letter to define the color.

Jerry, here's the info you requested:

I'm creating a table in which columns A and B are students' last and first names, respectively. The columns from C on correspond to questions on a multiple choice test.

I enter the students' answers in a row (Doe, John, C, A, B, D, A, A, etc.). I have two rules in place for each column:

Rule #1: If the answer is A (for example), then color the cell green (because it is correct).
Rule #2: If the answer is not A, then color the cell red (because it is incorrect).

This allows me a quick visual to see if a lot of students got the same answer wrong, which would mean I have to reteach the skill.

Ideally, I would like to also create totals, at the end of each row (for the number of questions the student answered correctly), and at the end of each column (for the number of students who answered each question correctly). I have done this in other tables, but never by counting colors; I have always had to individually assign calculations to each column by counting actual answers. I'd like to have a "general" rule that would count the ones that are defined as correct by being colored green (which is what I think Yvan is trying to lead me to, but I'm not sure how to do it).

I hope this makes it a little more clear.

Thanks again.
Laura

Dec 17, 2010 9:16 AM in response to Jerrold Green1

Jerry,

How do you use a conditional format rule to refer to the other table? That was the way I was originally going to do it, but I couldn't figure out how.

Count occurrences of the colors would allow me to use the same statement for all of the questions. Am I right that with the COUNTIF statement, I am going to need to write it for each question every time I give a test? (The answer sheets will have different correct answers.)

I was just wondering if there was a way to do it that would work no matter what the answer was. Maybe I should create two blank tables, set up the rules the way you said and test them, and when I know they work, just copy the whole sheet so the first could remain empty, and fill it in on the second sheet? Though I really don't want a new sheet each time...maybe select and copy both tables?

Laura

Dec 17, 2010 2:06 PM in response to LPeterson

Laura,

To conditionally format based on another cell, you just have to enter the cell address in the condition field. There's a shortcut. On the right side of the Condition field is an icon that looks like a cell with a pointer on it. Click the icon then click the cell that you want to compare to.

Here'a an example of what it seems to me that you are looking for overall...

!http://i618.photobucket.com/albums/tt262/jpb45un2/0b82925b.png!

In this example I use two auxiliary tables. One holds the answer key and the other checks the results separately from the formatting rules.

Expressions in the header rows and columns calculate the statistics based on sums of the "SCOREMATRIX" table.

Here are the formulas...

In Student Correct Total cells enter: =IF(ISBLANK(A), "", SUM(INDIRECT("SCOREMATRIX :: "&ROW())))

Fill Class Correct Total cells with: =SUM(SCOREMATRIX :: A)

Fill all cells of SCOREMATRIX with: =IF(ISBLANK(OFFSET(Data :: $A$1, ROW()-1, 0)),"",IF(OFFSET(Data :: $D$1, ROW()-1, COLUMN()-1)=OFFSET(AnsKey :: $A$1, 1, COLUMN()-1), 1,0 ))

If you want to give it a try, I'd be happy to answer any questions you might have.

Jerry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Using COUNTIFS to count cell color?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.