Count occurrences of string within another string using LEN and SUBSTITUTE
Here's an easy way to calculate the number of occurrences of a string within another string.
A | B | C | D | |
1 | String | Search String | Count | Formula |
2 | AaAaAaA | a | 3 | =(LEN(A2)-LEN(SUBSTITUTE(A2,B2,"")))/LEN(B2) |
3 | AaAaAaA | A | 4 | =(LEN(A3)-LEN(SUBSTITUTE(A3,B3,"")))/LEN(B3) |