84

I would like to use a conditional formatting rule in an excel file that would color any box with a question mark in it red. It seems that Excel is using a question mark as a wild card and will turn all cells with at least one character in them red. How can i escape the question mark?

These don't seem to work:

  • "?"
  • \?
  • '?'
  • ??
kzh
  • 4,243
  • 7
  • 28
  • 33

3 Answers3

116

Prefix it with tilde

~?

The tilde (~) is an escape character for special and wildcard characters in Excel. You can use escape characters to provide literal representations of characters that otherwise have a special meaning. You can also use tilde (~) followed by ?, *, or ~ to find question marks, asterisks, or other tilde characters — for example, fy91~? finds "fy91?"

Sharjeel Aziz
  • 3,261
  • 2
  • 20
  • 14
  • 35
    Prefix with a `~` ? Seriously ? What the rofl... Does anyone have an idea *why* ? Anyway, huge thanks. I'd never have figured out such a syntax alone. – Balmipour Jun 27 '17 at 15:43
4

Change the rule to "cells ending with" "?". This will color all cells with a question mark assuming it is the last character.

kzh
  • 4,243
  • 7
  • 28
  • 33
3

Also you can use Specific Text > Contains > ~? This tells excel to ignore symbol command and treats the cell as text.

user667254
  • 31
  • 1