Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
CODE is the inverse of CHAR — it takes a text string and returns the numeric character code of its first character according to the ASCII/ANSI table. Use it to inspect character values, detect non-printing characters, or build custom sort logic based on character codes.
=CODE(A2)=CODE(A2)Computed by a real spreadsheet engine on the sample data below.
| Text | Code |
| Apple | =CODE(A2) |
| Banana | =CODE(A3) |
| Cherry | =CODE(A4) |
| Date | =CODE(A5) |
=CODE(A2)→65
Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
Need a version for your data?
Try: “Find the ASCII code of the first character in each cell to detect leading symbols”
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: