Consider the following two formulas:
=IF(SEARCH("*", A1), "true", "false")
=IF(SEARCH(CHAR(42), A1), "true", "false")
I am using this to try and detect if a cell contains a *
character, but this returns "true" for all cells. I can only assume that Excel sees *
as a wildcard maybe.
How do you detect the existence of a *
in Excel?
Wildcards in Excel are the special Excel characters that take the place of the characters in it. Excel has three wildcards: an asterisk, question mark, and tilde. Asterisk is used for multiple numbers of characters in Excel, while a question mark represents only a single character.
According to this reference of microsoft you should be able to use ~
Microsoft Excel uses the tilde (~) as a marker to indicate that the next character is a literal. When you use the Find and Replace dialog box to find or replace a character such as a tilde (~), an asterisk (*), or a question mark (?), you must add a tilde (~) before the character in the Find what box.
So change =IF(SEARCH("*", A1), "true", "false")
to =IF(SEARCH("~*", A1), "true", "false")
and it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With