Another Countif Query

Fazila

Board Regular
Joined
Nov 19, 2014
Messages
163
Hello

I have a table similar to the one below:

English TeacherEnglish Teacher TargetEnglish Teacher AssessmentMaths TeacherMaths Teacher TargetMaths Teacher AssessmentScience TeacherScience Teacher TargetScience Teacher Assessment
abb-eddiss+
bdbfsd+jmm-
csb+gms-kbb
dmd-hbs+ldb+

<tbody>
</tbody>

I need to count the number of bs, ds, s' and ms in all the columns headed with ...Teacher Assessment.

The formula I have tried to use so far is =SUM(COUNTIF(INDEX(RawData,0,MATCH("*teacher assessment*",RawDataHeadings,0)),{"b-";"s1";"s2";"s3";"b-1";"b-2";"b-3"})) (the bit in bold highlights the many variations I need to count but only for this column).

For the other columns it will be simply B, B+, D- etch.

The result it is returning is 2 - the result should be well over 200.

Any ideas as to where I am going wrong?

Thanks
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
So the problem is it is only counting from the first column how can I make the formula count from every column that contains the words “teacher assessment”?
 
Upvote 0
Is it true that you don't care if there is a + or -, just if the b,d,s,m is in the cell? Then maybe:

ABCDEFGHI
1English TeacherEnglish Teacher TargetEnglish Teacher AssessmentMaths TeacherMaths Teacher TargetMaths Teacher AssessmentScience TeacherScience Teacher TargetScience Teacher Assessment
2abb-eddiss+
3bdbfsd+jmm-
4csb+gms-kbb
5dmd-hbs+ldb+
6
7
812

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
A8=SUMPRODUCT(ISNUMBER(SEARCH(SUBSTITUTE(SUBSTITUTE(A2:I5,"-",""),"+",""),"bdsm"))*ISNUMBER(SEARCH("assessment",A1:I1)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Control+shift+enter, not just enter:

=SUM(IF(ISNUMBER(SEARCH("Teacher Assessment",A1:I1)),IF(ISNUMBER(MATCH(LEFT(A2:I5),{"b","d","s","m"},0)),1)))
 
Upvote 0
Is it true that you don't care if there is a + or -, just if the b,d,s,m is in the cell? Then maybe:

ABCDEFGHI
1English TeacherEnglish Teacher TargetEnglish Teacher AssessmentMaths TeacherMaths Teacher TargetMaths Teacher AssessmentScience TeacherScience Teacher TargetScience Teacher Assessment
2abb-eddiss+
3bdbfsd+jmm-
4csb+gms-kbb
5dmd-hbs+ldb+
6
7
812

<tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
A8=SUMPRODUCT(ISNUMBER(SEARCH(SUBSTITUTE(SUBSTITUTE(A2:I5,"-",""),"+",""),"bdsm"))*ISNUMBER(SEARCH("assessment",A1:I1)))

<tbody>
</tbody>

<tbody>
</tbody>

Unfortunately I need to consider the + and -. So I will need to count the number of B- in all the columns which contain Teacher Assessment in the column, then all the Bs, B+s etc.
 
Upvote 0
Did you read the bit that says control+shift+enter not just enter? You need to follow that instruction.
 
Upvote 0
Did you read the bit that says control+shift+enter not just enter? You need to follow that instruction.

Yes I did but still no luck

I've tried to simplify and try using countifs i.e.:

=countifs(rawdataheadings,"*Teacher Assessment*",rawdata,E1)

But get a #Value ! response

If I split them apart and do

=countif(rawdataheadings,"*Teacher Assessment*") I get the result 30
=countif(rawdata,"B") I get the result 894

But combined I get a Value used in the formula is of the wrong data type!
 
Upvote 0
Why are you using countifs? You cant. What aladin gave you works perfectly well but requires CSE entry.
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,411
Members
449,081
Latest member
JAMES KECULAH

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