A | B | |
---|---|---|
1 | Banana | TRUE |
Worksheet Formulas
<thead> </thead><tbody> </tbody> |
If the goal is to return TRUE or FALSE, then this is enough...This works, although it might not be elegant enough for you:
Excel 2016 (Windows) 32 bit
A B 1 Banana TRUE
<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>Sheet1
Worksheet Formulas
Cell Formula B1 =IF(LEN(A1)-LEN(SUBSTITUTE(A1,"a",""))=1,TRUE,FALSE)
<thead>
</thead><tbody>
</tbody>
<tbody>
</tbody>
I can't believe I typed a greater than symbol instead of an equal sign!If the goal is to return TRUE or FALSE, then this is enough...
=LEN(A1)-LEN(SUBSTITUTE(A1,"a",""))>1
Function ContainsJustOne(testString As String, Char As String) As Boolean
If Len(testString) - Len(Replace(testString, Char, "")) = Len(Char) Then ContainsJustOne = True
End Function