How To Generate A Random Letter

2017-08-17

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 freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Subscribe

Advertisement

Related Articles

Comments

0 Comments

Get The Latest News

Follow Us

Follow us on social media to stay up to date with the latest tips in Excel!

Pin It on Pinterest

Share This