Home » excel » How to make FIND function exact in Excel

# How to make FIND function exact in Excel

Questions:

I’m using the FIND function in Excel to check whether certain characters appear in a string of characters in a cell.

However, this function doesn’t work cleanly for certain special characters. Specifically F̌,B̌, and some others. When F̌ appears in the string, FIND recognizes it as both F and F̌.

Notable that this is not the case for characters such as Ď and Č. FIND works nicely for these.

How can I get the formula to always differentiate between characters with and without the hat? Is there a way to work in EXACT?

Thank you!

It is because `F̌` is actually two characters.

`=LEN("F̌")` returns `2` not `1`. The second character is the hat.

If you do:

``````=UNICHAR(70)&UNICHAR(780)
``````

It will return the `F̌`

And as such `=FIND("F","F̌")` will return `1` as it is the first letter of a two character string.

To find “F” in `A,B,F̌,F` use:

``````=AGGREGATE(15,7,ROW(\$ZZ1:INDEX(\$ZZ:\$ZZ,LEN(A1)))/((MID(A1,ROW(\$ZZ1:INDEX(\$ZZ:\$ZZ,LEN(A1))),1)="F")*(MID(A1,ROW(\$ZZ2:INDEX(\$ZZ:\$ZZ,LEN(A1)+1)),1)<>UNICHAR(780))),1)
``````

To find either then we need to use IF:

``````=IF(LEN(A2)=2,FIND(A2,A1),AGGREGATE(15,7,ROW(\$ZZ\$1:INDEX(\$ZZ:\$ZZ,LEN(A1)))/((MID(A1,ROW(\$ZZ\$1:INDEX(\$ZZ:\$ZZ,LEN(A1))),1)=A2)*(MID(A1,ROW(\$ZZ\$2:INDEX(\$ZZ:\$ZZ,LEN(A1)+1)),1)<>UNICHAR(780))),1))
``````

``````=FIND("F,",A5&",")
That will find an `F` in A5, but will not find an `F` if only `F̌` is present