Sunday, October 9, 2011

Find questions marks (?) and asterisks (*) in Excel




Excel treats some characters differently than others when you do a search (cntrl+F). If you try to search for a ? or a *, it won't take you to their location.

According to this site if you precede your search with a tilda (~) the search function will locate the question marks.

So, to find a ?, enter ~? into the search field.
To find a *, enter ~*
and to find a tilda itself, enter ~~.

This odd complication is probably due to the fact that ?, * and ~ are "metacharacters" used for special functions in other programming contexts (specifically "regular expressions"). Why these three cause problems, and other metacharacters such as {, [, . , $, ^ and < don't, however, is a mystery to me.

No comments:

Post a Comment