Count a Word occurrence in a column number of times

abdulads

Board Regular
Joined
Dec 22, 2013
Messages
85
Grade (wanted to count in a table how many times A1 or B1 ora2 or b2 is occuring and if its occuring in a cell two times then count only half(0.5) and if 3 Grades then (0.33)
A1, B1
B1
B2
A2
A2,B2
B1,B2
 
With helper column B where 1/2; 1/3 etc is calculated:
See below for formulas for B2 to be copied down and D2 to be copied right of course D1; E1, ... are the possible grades

Book1
ABCDEFGHI
1GradehelperA1A2B1B2A3
2A1, B10,50,51,5220
3B11
4B21
5A21
6A2,B20,5
7B1,B20,5
8
Sheet2
Cell Formulas
RangeFormula
D2:H2D2=SUMPRODUCT(ISNUMBER(FIND(D1,$A$2:$A$100))*$B$2:$B$100)
B2:B7B2=1/(LEN(A2)-LEN(SUBSTITUTE(A2,",",""))+1)
 
Upvote 0
Without helper column,. ARRAY formula in E2 copied down.
=SUM(IF(ISNUMBER(FIND(D2,TRANSPOSE($A$2:$A$7))),1/MMULT(1*TRANSPOSE(ROW($D$2:$D$5)>0),1*ISNUMBER(FIND($D$2:$D$5,TRANSPOSE($A$2:$A$7)))),0))

Book1
ABCDEF
1
2A1, B1A10.5
3B1B12
4B2A21.5
5A2B22
6A2,B2
7B1,B2
8
Sheet3
Cell Formulas
RangeFormula
E2:E5E2=SUM(IF(ISNUMBER(FIND(D2,TRANSPOSE($A$2:$A$7))),1/MMULT(1*TRANSPOSE(ROW($D$2:$D$5)>0),1*ISNUMBER(FIND($D$2:$D$5,TRANSPOSE($A$2:$A$7)))),0))
Press CTRL+SHIFT+ENTER to enter array formulas.

To enter ARRAY formula
Copy and paste the formula in cell
Press F2
Press Ctrl+Shift+Enter together
Excel covers the formula with {}.
 
Upvote 0
@abdulads
Please update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
.. or just combine the two formulas from post 2 into one

25 03 10.xlsm
ABCDE
1
2A1, B1A10.5
3B1B12
4B2A21.5
5A2B22
6A2,B2A30
7B1,B2
Sheet2 (3)
Cell Formulas
RangeFormula
E2:E6E2=SUMPRODUCT(ISNUMBER(FIND(D2,A$2:A$7))/(LEN(A$2:A$7)-LEN(SUBSTITUTE(A$2:A$7,",",""))+1))
 
Upvote 0
With helper column B where 1/2; 1/3 etc is calculated:
See below for formulas for B2 to be copied down and D2 to be copied right of course D1; E1, ... are the possible grades

Book1
ABCDEFGHI
1GradehelperA1A2B1B2A3
2A1, B10,50,51,5220
3B11
4B21
5A21
6A2,B20,5
7B1,B20,5
8
Sheet2
Cell Formulas
RangeFormula
D2:H2D2=SUMPRODUCT(ISNUMBER(FIND(D1,$A$2:$A$100))*$B$2:$B$100)
B2:B7B2=1/(LEN(A2)-LEN(SUBSTITUTE(A2,",",""))+1)
Thank you so much.
 
Upvote 0
Without helper column,. ARRAY formula in E2 copied down.
=SUM(IF(ISNUMBER(FIND(D2,TRANSPOSE($A$2:$A$7))),1/MMULT(1*TRANSPOSE(ROW($D$2:$D$5)>0),1*ISNUMBER(FIND($D$2:$D$5,TRANSPOSE($A$2:$A$7)))),0))

Book1
ABCDEF
1
2A1, B1A10.5
3B1B12
4B2A21.5
5A2B22
6A2,B2
7B1,B2
8
Sheet3
Cell Formulas
RangeFormula
E2:E5E2=SUM(IF(ISNUMBER(FIND(D2,TRANSPOSE($A$2:$A$7))),1/MMULT(1*TRANSPOSE(ROW($D$2:$D$5)>0),1*ISNUMBER(FIND($D$2:$D$5,TRANSPOSE($A$2:$A$7)))),0))
Press CTRL+SHIFT+ENTER to enter array formulas.

To enter ARRAY formula
Copy and paste the formula in cell
Press F2
Press Ctrl+Shift+Enter together
Excel covers the formula with {}.
Thank you so much.
 
Upvote 0
.. or just combine the two formulas from post 2 into one

25 03 10.xlsm
ABCDE
1
2A1, B1A10.5
3B1B12
4B2A21.5
5A2B22
6A2,B2A30
7B1,B2
Sheet2 (3)
Cell Formulas
RangeFormula
E2:E6E2=SUMPRODUCT(ISNUMBER(FIND(D2,A$2:A$7))/(LEN(A$2:A$7)-LEN(SUBSTITUTE(A$2:A$7,",",""))+1))
Thank you so so much it worked
 
Upvote 0

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