#1   Report Post  
Ben Blair
 
Posts: n/a
Default Countif layering

I have a data file of three columns: one is a subject (math, art, etc.), the
second contains a code for the first student to get it right (AA, e.g.) and
the students that got it wrong (AA, e.g.). My data looks something like this,
but much longer:
A B C
Math AA AE
Sci AB none
Lit BE BA
Art BC AA, AC
Math AD AE

I want to compute the number of right and wrong for each cubject for each
student, in a sheet like this one:
Math R Math W Art R Art W.....
AA x y
AB
AC
AD
BA

What is the best way to calculate these numbers? What combination of
functions should I use for x and y? Thanks in advance.

  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

With multiple entries in a single cell in columns B & C, you've got a mess to
deal with. If the row you have shown as

Art BC AA, AC

was broken into 2 rows

Art BC AA
Art AC

and the same for all other rows where you have multiple codes in a single
cell, you could get your desired results VERY, VERY EASILY with pivot table.

Short of that, I'm not sure how you could get from where you are to an
accurate result like what you want.


"Ben Blair" wrote:

I have a data file of three columns: one is a subject (math, art, etc.), the
second contains a code for the first student to get it right (AA, e.g.) and
the students that got it wrong (AA, e.g.). My data looks something like this,
but much longer:
A B C
Math AA AE
Sci AB none
Lit BE BA
Art BC AA, AC
Math AD AE

I want to compute the number of right and wrong for each cubject for each
student, in a sheet like this one:
Math R Math W Art R Art W.....
AA x y
AB
AC
AD
BA

What is the best way to calculate these numbers? What combination of
functions should I use for x and y? Thanks in advance.

  #3   Report Post  
bj
 
Posts: n/a
Default

The right answers ones are pretty easy

if your totals table is in sheet2 Manes in Column A and courses in the first
row
Assuminc Column B is Math R
enter in B2
=sumproduct(--(Sheet1!$B$1:$B$1000=$A2),--(Sheet1!$A$1:$A$1000="Math"))
Copy to the Art R and Lit R columns changing "Math" to "Art" and "Lit" as
appropriate.
Copy this down to the end of your student list

since there can be multiples in the Wrong column this equaiton gets a little
more complex
If you can change the wrong column into separate cells for each wrong person
Look at Data-Text to Columns with Comma delimiter for one method
enter in the cell under the Math W cell
=sumproduct( --(Sheet1!$c$1:$c$1000=$A2)
--(Sheet1!$D$1:$D$1000=$A2)--(Sheet1!$E$1:$E$1000=$A2),--(Sheet1!$A$1:$A$1000="Math"))
*Add as many sections in first part as is needed.*
or
=sumproduct(--(if(iserror(find($A2,
Sheet1!,$C$2:$C$1000),0,1),--(Sheet1!$A$1:$A$1000="Math"))
Copy these to the LIT W and Art W columns Making appropriate changes and
copy for your student list.



"Ben Blair" wrote:

I have a data file of three columns: one is a subject (math, art, etc.), the
second contains a code for the first student to get it right (AA, e.g.) and
the students that got it wrong (AA, e.g.). My data looks something like this,
but much longer:
A B C
Math AA AE
Sci AB none
Lit BE BA
Art BC AA, AC
Math AD AE

I want to compute the number of right and wrong for each cubject for each
student, in a sheet like this one:
Math R Math W Art R Art W.....
AA x y
AB
AC
AD
BA

What is the best way to calculate these numbers? What combination of
functions should I use for x and y? Thanks in advance.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
COUNTIF COMBINATION?? Heather Excel Worksheet Functions 1 April 26th 05 02:44 AM
Combining IF and COUNTIF based on two columns maxtrixx Excel Discussion (Misc queries) 5 March 31st 05 06:21 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM
Countif - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM
countif, again Liz G Excel Worksheet Functions 2 November 1st 04 11:20 PM


All times are GMT +1. The time now is 10:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"