Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've trying to create a Error Log to help me analyse my mistakes. So for simplicity, lets assume I have two columns "Type of Question" - with values SC,RC,CR and another column that indicates whether I got this question "right/wrong".Let's assume this is my table:

Question No. | Right/Wrong | Question Type

  1. | Right | SC

  2. | Right | RC

  3. | Wrong | SC

  4. | Wrong | CR

  5. | Right | RC

(Pardon my formatting skills).

And I want an output table like this

Type of Question | Right | Wrong | Total

SC | 1 | 1 | 2

RC | 2 | 0 | 2

CR | 0 | 1 | 1

So basically what I want to do is check Column3 for SC using =COUNTIF(C1:C5,"SC"), and return the total number of SC questions, and then outta the SC , I need to find out which are Right.If I know the right and the total I can get the wrong.

I have never written a macro so a formula based answer would suffice.

share|improve this question

migrated from stackoverflow.com Oct 8 '12 at 2:45

This question came from our site for professional and enthusiast programmers.

1  
If you are using excel 2007 or later look into Countifs –  chris neilsen Oct 7 '12 at 18:28

2 Answers 2

You can do this with SUMPRODUCT even in Excel 2003 and earlier versions, e.g.

=SUMPRODUCT((C1:C5="SC")*(B1:B5="Right"))

share|improve this answer

COUNTIFS lets you specify several criterias.

In your case =COUNTIFS(C1:C5;"SC";B1:B5;"Right")

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.