In Excel, the CHAR function is a useful text function that returns a character specified by a numeric code based on the ASCII (American Standard Code for Information Interchange) system.
Your formulas—
CHAR(SEQUENCE(26,,65,1)) for uppercase letters and CHAR(SEQUENCE(26,,97,1)) for lowercase letters—leverage this function creatively to generate the alphabet. Let’s break it down.
Brief Summary of the CHAR Function
The CHAR function in Excel takes a number (ASCII code) as its argument and returns the corresponding character. For example, CHAR(65) returns "A", and CHAR(97) returns "a". The ASCII codes for uppercase letters range from 65 (A) to 90 (Z), while lowercase letters range from 97 (a) to 122 (z). When paired with other Excel functions like SEQUENCE, it becomes a powerful tool for generating lists of characters.
How Your Formula Works
SEQUENCE(26,,65,1):
The SEQUENCE function generates a list of numbers in Excel.
Here, 26 specifies the number of rows (one for each letter of the alphabet).
The empty second argument defaults to 1 column.
65 is the starting number (ASCII code for "A").
1 is the step increment, meaning it increases by 1 for each subsequent number (65, 66, 67, ..., 90).
Result: An array of numbers from 65 to 90.
CHAR(SEQUENCE(26,,65,1)):
The CHAR function takes this array and converts each number into its corresponding uppercase letter.
Output: "A", "B", "C", ..., "Z" in a vertical list (in Excel 365 or 2021, which support dynamic arrays).
SEQUENCE(26,,97,1):
Similar to the above, but starts at 97 (ASCII code for "a") and goes up to 122 ("z").
CHAR(SEQUENCE(26,,97,1)):
Converts the numbers 97 to 122 into lowercase letters: "a", "b", "c", ..., "z".
Use of CHAR Function in Points
Text Generation: Creates specific characters (e.g., CHAR(10) for a line break in Excel).
Alphabet Lists: As in your example, generates sequences of letters when combined with SEQUENCE.
Formatting: Adds special characters (e.g., CHAR(169) for ©) to cells or formulas.
Data Cleaning: Replaces or inserts characters based on their ASCII codes in text strings.
Dynamic Arrays: Works seamlessly with modern Excel features like SEQUENCE to spill results into multiple cells.
Welcome to Excel Online Advisor, where we share expert tips and tricks for mastering Microsoft Excel.
✅ Need Help ? Ping Here (Telegram) - https://t.me/+UAVHfg7OMBk5M2M1
✅ Instagram - / excelonlineadvisor
✅ Youtube - / @excelonlineadvisor