How To Generate A Random Letter

Example

=CHAR(RANDBETWEEN(B3,C3))

Generic Formula

=CHAR(RANDBETWEEN(Lower,Upper))
  • Lower – This is an integer value and will depend on what type of character you want to generate.
  • Upper – This is an integer value and will depend on what type of character you want to generate.

What It Does

This formula will generate a random letter or symbol.

How It Works

RANDBETWEEN(Lower,Upper) will generate a random integer value between the Lower and Upper values. We then convert this randomly generated number into its ASCII character equivalent using the CHAR function.

  • CHAR(N) for N = 65 to 90 will result in the characters A to Z
  • CHAR(N) for N = 97 to 122 will result in the characters a to z
  • CHAR(N) for N = 33 to 47 will result in the characters ! ” # $ % & ‘ ( ) * + , – . /
  • CHAR(N) for N = 58 to 64 will result in the characters : ; < = > ? @
  • CHAR(N) for N = 91 to 96 will result in the characters [ \ ] ^ _ `

In our example RANDBETWEEN(65,90) resulted in a value of 84 and CHAR(84) returns the character T.

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and qualified actuary with over 15 years of experience. He has worked in a variety of industries, including insurance, ad tech, and most recently Power Platform consulting. He is a keen problem solver and has a passion for using technology to make businesses more efficient.

Related Posts

Comments

0 Comments

Get the Latest Microsoft Excel Tips

Follow Us

Follow us to stay up to date with the latest in Microsoft Excel!

Subscribe for awesome Microsoft Excel videos 😃