How to Quickly Generate Random Letters in Excel

- Written by Puneet


Ever faced a situation where you need to generate random letters? Well, sometimes you do need to generate some random alphabets.

Right? In Excel, you have functions like RAND and RANDBETWEEN to generate random numbers, but we don’t have any particular function to generate letters.

Today, I’d like to share with you an amazing formula trick to generate random letters in Excel. And, the best part is it’s simple and easy to use.

So what’s the Formula to Generate Random Letters in Excel?

As I said, there is no direct function in excel that can help you to get random letters/alphabets. But, you can use a combination of RANDBETWEEN and CHAR to create a formula to get random letters.

If you want to Generate CAPITAL Random Letters

In this formula, you need to use 65 and 90 for the random letter to be in the capital letter.

generate random letters with capital letters

Or if you want to Generate Small Random Letters:

In this formula, you need to use 97 and 122 for the random letter to be in the capital letter.

generate random letters with small letters

How this formula works

Now, let me tell you how this formula generates these letters. First of all, you have to understand that this formula works in two different parts.

how this formula generate random letters

In the first part, you have the RANDBETWEEN function which can generate random numbers for you. You just have to specify the lowest number and highest number and it will return a random number from that range. In short, you will get a random number in the result within the range.

generate random letters edit randbetween

Now, in the second part, you have the CHAR function which can return a specific character when you specify a number in it. That means for each character there is a specific number you have to insert in the CHAR function. And numbers 65 to 90 represent capital letters and 97 to 122 small letters.

generate random letters edit char

If you enter 65 in CHAR it will return “A” and for 97 it will return “a”.

The Bottom Line is:

  • When you specify any of the above ranges RANDBETWEEN returns a random number.
  • And after that CHAR returns a character for that number.
generate random letters drop down

This is the whole story.

In the end,

The formula you have used above is simple and easy to apply, there’s no doubt about it. The best use of this method in the real world which I have found is you can generate random groups for participants based on the alphabet.

Do you have any other method to create random letters?

Make sure to share your views with me in the comment section, I’d love to hear from you and please, don’t forget to share this post with your friends, I am sure they will appreciate it.

Get the Excel File

Last Updated: December 02, 2023

24 thoughts on “How to Quickly Generate Random Letters in Excel”

  1. Hey sir thanks you alot for you explain. I’d like to ask you how can I write a random letters just in blank cells

  2. If you want a mix of upper and lower case then you can use:


    This works because upper case letters start at 65 and lower case letters start at 97, a difference of 32.

    RANDBETWEEN(65,90) will generate a random upper case letter code, and the 32*RANDBETWEEN(0,1) will randomly add 0 or 32 to the letter code.

    If it adds 0 then it will remain upper case, if it adds 32 then it will switch it to lower case.

  3. how can we create unique code there is including numbers and alphabetics excluding
    A,S,T,M …???????????????

    • @Aakil

      You could put all the letters you want in column A, e.g.:

      Then you could use


      If you have more than 4 letters to choose from, then increase the ‘4’ in the formula to match.

  4. What if I want the first few letter to always be the same? Then say three random number and letters
    So CHD725KLH, CHD128DHL, CHD631PXY as an example

    • Hi, Christina,
      try this:

      P.S. Thanks, Puneet, for interesting articles. Good job 🙂

    • Hi Christiana,

      Try this too

  5. To keep within Windows Rules something a formula like
    would be useful

  6. Interesting piece. Please what if I want to generate 5 alphabets and the result to be in one single cell like “B, E, H, P, G”. Do I have to write the formula above and concatenate/ampersand them or is there a shorter and better means? Thank you


Leave a Comment