My spreadsheet has different types of grading. My goal is to count each type using Count If formula. Counting "AC-", I used =countif(B:B5,"*AC-*") and the count is correctly showing 1. However, counting "P-", the formula =countif(B:B5,"*P-*") is showing 3 because of results from "P-Redo", "AP-Superb", "P-Poor". I am trying to create a formula to count only "P-" and ignore "AP-Superb". Thanks.
| Name | Type |
|---|---|
| Kevin | AC-Mediocre, P-Redo |
| Linda | AB-Decent, AP-Superb |
| Jen | P-Poor |
I have tried using regexmatch and used "^" to find the start of a string. =SUMPRODUCT(REGEXMATCH(B:B5, "(^)P-")) but my regexmatch formula is not correct.
>Solution :
You may try with this slight change in your current regex formula:
=SUMPRODUCT(REGEXMATCH(B$1:B$5,"\b"&A26))
