0

I've always used...

'

...but just found out while reading through a couple of other Q&A's here that there are additionally...

~
\

Why are there multiple escape characters and what are they used for?

Arctiic
  • 1,001
  • 1
  • 6
  • 23
  • [How can I escape special characters in cell formatting in Excel - Super User](https://superuser.com/questions/612434/how-can-i-escape-special-characters-in-cell-formatting-in-excel) – DavidPostill May 19 '19 at 12:22
  • [vlookup - Working with "~" in excel - Super User](https://superuser.com/questions/603266/working-with-in-excel) – DavidPostill May 19 '19 at 12:23
  • Hi @DavidPostill those two posts are actually the posts I was referring to above! I'm not very clear on the differences between them, and what necessitates three types of escapes? Just curious about the correct usage for them respectively -- assuming they *do* somehow differ from one another. – Arctiic May 19 '19 at 12:57
  • I did see, if I am understanding correctly, that the ' character will escape the cell contents "as text". – Arctiic May 19 '19 at 12:59

1 Answers1

0

While reviewing my past unanswered questions, I thought I'd come back and take a shot at answering this one myself.

' (when prefixed to direct cell inputs) will convert the output of the cell contents to be displayed As Text. Functionally, this will achieve the equivalent effect as escaping certain characters in terms of visual/typographical output; this does in turn make the cell data harder to work with for formulations or computations in the time since I've written this answer, newer versions of Excel have gained functions, e.g., value(), etc., that improve QoL when working across mixed data types and/or formatting.

\ acts as an escape character for the immediately subsequent character entered, but is particularly used in cell data type formatting or custom formatting rather than for explicit inputs; this enables the user to escape certain characters reserved by Excel for special formatting functions, e.g., the : in cell formatting set as "#:#" normally outputs the resultant data as a Time data type, and would need to be escaped as "#\:#" to mitigate this behavior

~ acts as an escape character for actual cell-input characters, and will behave much in the same way as described above: namely, it will process the immediately subsequent character input as a literal (or for AHK users, think of it as SendRaw).

Hope that explains with more clarity what the respective usage cases are and how they differ from one another!

Related Posts & Acknowledgements:

And my thanks to @DavidPostill for including the actual reference links.

Arctiic
  • 1,001
  • 1
  • 6
  • 23