Arte SheetsLearn. Try. Understand.

Text

CHAR and CODE: insert line breaks CHAR(10) and inspect hidden character codes

Generate non-keyboard characters like CHAR(10) line feeds or increment letter sequences with CHAR and CODE.

Inspect exact character codes when strings refuse to match

CODE(text) returns the numeric character code of the first character in text—and unlike = comparisons, CODE is strictly case-sensitive: CODE("A") = 65 while CODE("a") = 97.

CHAR(number) is the inverse: CHAR(65) returns "A", CHAR(10) inserts a line break inside concatenated mailing labels, and CHAR(CODE(A2) + 1) steps "A" to "B".

Sample (A)CODE(A)Next Letter CHAR(CODE(A)+1)
A65B
a97b

Step letter codes and build multi-line labels

Incrementing CODE(A2) by 1 inside CHAR produces sequential revision letters (A -> B -> C).

=CHAR(CODE(A2) + 1)

Guard empty cells before calling CODE

An empty cell or "" string has no character to inspect; check OR(ISBLANK(C2), LEN(C2)=0) first so empty rows return a clear label.

=IF(OR(ISBLANK(C2), LEN(C2)=0), "Empty", CODE(C2))

Try the example

Use the original values or change them to test your understanding.

Further reading