1

I cannot seem to find a way to do this. I have five cells in excel. I want to concatenate them into a string randomly. I want to use each cell character once in the string I am building, so I end up with a five-character string, no repeats. Say, I have A1 = Y, B1 = u, C1 = 6, D1 = %, E1 = z I want to build a string that has each character in a random order uY6%z or zY%u6 either are equally acceptable (et cetera)

Is there a way to do this?

0

You can perform a Fisher-Yates shuffle in VB for applications (VBA), for instance using the algorithm implementation displayed here.

Be sure to use a good random number generator, a cryptographically secure one if so required. Randomize is only seeded by the system time, so I would not run a lottery with it.

0

This looks like it describes what you want?

https://www.extendoffice.com/documents/excel/2484-excel-random-number-no-duplicates-no-repeat.html

Once you get the no-duplicates list of numbers, you can use that to INDEX() into your values with CONCATENATE().

  • This does not really address my situation. I am generating random characters to go into a password, so not all numbers, A special character, an upper case letter, a lower case letter, a number, and one that can be any of the above. The link seems to talk about numbers, and numerical testing. – tsbarker13 Sep 20 '17 at 22:20

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.