Allocating Unique characters

prasadmoghe.pm

New Member
Joined
Aug 12, 2011
Messages
3
Query:
I have 1 to 5 number in five rows from A1 to A5 and I need to allocate randomly 2 alphabets from a to z for each number in cells B1 & C1. The condition is that the alphabets should not get repeated for any number and across the numbers. E.g

1 a b
2 c d
3 e f
4 g h
5 i j

I have tried using INT and RAND() function with array of alphabets but there is a possibility of duplicates.

Thank you in advance.

Regards,
Prasad

 
Last edited by a moderator:

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi Prasad,

Try this:

  1. In each of the cells D1 to D26 enter "=RAND()"
  2. In cell B1 enter "=CHAR(96+RANK(D1,$D$1:$D$26))" and drag the formula down to cell B5
  3. In cell C1 enter "=CHAR(96+RANK(D6,$D$1:$D$26))" and drag the formula down to cell C5

  • The RAND function produces random numbers between 0 and 1.
  • The RANK function ranks the random numbers in column D returning unique integers from 1-26.
  • The CHAR function returns a character based on the ASCII value (97 to 122 are the letters a-z).
For more about random selection in Excel, the below resource is great:
http://www.tushar-mehta.com/excel/newsgroups/rand_selection/

:-D
 
Upvote 0
Hi Prasad,

Try this:

  1. In each of the cells D1 to D26 enter "=RAND()"
  2. In cell B1 enter "=CHAR(96+RANK(D1,$D$1:$D$26))" and drag the formula down to cell B5
  3. In cell C1 enter "=CHAR(96+RANK(D6,$D$1:$D$26))" and drag the formula down to cell C5

  • The RAND function produces random numbers between 0 and 1.
  • The RANK function ranks the random numbers in column D returning unique integers from 1-26.
  • The CHAR function returns a character based on the ASCII value (97 to 122 are the letters a-z).
For more about random selection in Excel, the below resource is great:
http://www.tushar-mehta.com/excel/newsgroups/rand_selection/

:-D

have a look at MRAND in Morefunc addin,
here you can have randum numbers without duplicates
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top