MrExcel's Learn Excel #534 - Counting Xs

If you like this content, please consider visiting the video on YouTube and subscribe to the MrExcel Channel to show your support!
This video has been published on Aug 4, 2009.
Kyle is trying to build a worksheet to create practice SAT tests for his students. His IF formula to mark answers as correct is working fine, but the COUNT function cant seem to count the correct answers. Episode 534 troubleshoots this function.

This blog is the video podcast companion to the book, Learn Excel from MrExcel. Download a new two minute video every workday to learn one of the 277 tips from the book!
maxresdefault.jpg


Transcript of the video:
Hey welcome back to the MrExcel netcast.
I'm Bill Jelen, today's question comes from Kyle in California.
If you have a question for the podcast send it in.
We will get to you on a future podcast.
Kyle setting up a workbook for his students to use when taking practice ACT test or SAT tests, and basically he allows the students to enter their answer in COLUMN B and he has hidden in COLUMN C the correct answer.
So his formula over here in COLUMN D is a fairly straightforward if statement says =IF(B2=C2,’’X’’,’’’’).
In other words, if the student got the answer right then he puts an X otherwise he puts QUOTE QUOTE he puts nothing, and everything was working great till Kyle came down to the end and used the count function to try and count how many Xs there are.
Well you know the first problem we have is COUNT only counts numeric values it doesn't count text values, and so then you might try and use the COUNTA function, COUNTA is used for counting either numeric or text.
Unfortunately when we use COUNTA, all of those QUOTE QUOTES get counted as something.
So that doesn't work either.
I told Kyle that we have to start using The COUNTIF function, we're going to look through the range of Xs or blanks and count how many are equal to in quotes uppercase X =COUNTIF(D2:D11 ,’’X’’), and sure enough that works.
We have five, if someone gets the right answer here in question number 9 it increases to six, so that's one solution.
The other solution that I suggested was that instead of using an X and a blank you just simply use a 1 and a blank =IF(B2=C4, 1 ,’’’’). Copy that down to all of our cells and then once the ones or blanks are there, it's very easy just to use the SUM function to go through and sum up all of those 1 values =SUM(D2:D11).
So if you don't care about presentation you're just trying to get the total score using the 1 is the way to go.
Otherwise COUNTIF, great little function that we have and there's also a SUMMIT function that will talk about some of the days.
Thanks to Kyle for sending in that great question.
If you have a question please feel free to drop us a line, otherwise we'll see you next time for another netcast from MrExcel.
 

Forum statistics

Threads
1,215,043
Messages
6,122,825
Members
449,096
Latest member
Erald

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