+ Reply to Thread
Results 1 to 13 of 13

Generating Random Numbers between Upper & Lower Limits and without Repeats.

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Dear Forum,

    I need to randomize few entries ROW-WISE and some entries COLUMN-WISE..
    All these entries , i.e names are given a number however I want to randomize the order and I am trying with the rand() function however I keep on getting repeats , I need the entries only once but randomly arranged..

    Will need them to have some COlumn-WISE too, the file will be shared with lower versions of Excel 2003 so I cant rrosk of using randbetween() and also the entries are more than 200+.

    SO can someone please help me with a good formula..

    Warm Regards
    e4excel
    Last edited by e4excel; 03-18-2012 at 12:31 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Hi e4excel,

    See http://www.techonthenet.com/excel/formulas/rand.php for building a randbetween using older versions of excel.

    It is a little contradictory to say you want random numbers but they can't repeat. I'm not sure you really mean that. If you do then sorting a row of numbers using a helping column has worked for me.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Hi MarvinP,

    Thanks for the Link, I need to use the application of RANDOM-ITY for several purposes one is to generate a questionnaire comprosing of more than 200 Set of Questions any question can be choosen and none of the Questions repeated again..

    Then I need to randomize a list of Names Vertically ROW-WISE as well as Horizontally COLUMN_WISE

    So, I need to mention the Upper Bound which can be a COUNTA FORMULA to count the no of entries and it gets randomized with no repeats..

    Warm REgards
    e4excel

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Bump NO Response

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Hi e4excel,

    Sorry about not looking back far enough for your reply. The normal way to sort without repeats is to simply sort the rows based on a rand() function in a new column. If you need to do it again you could copy the table and paste it using transpose and do it again. See the attahced that started as a normal multiplication table. I added a column L and sorted by it. Then copy and paste using transpose and did it again. The result is randomly sorted rows and columns.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Hey thnks actually I should have uploaded a WorkSheet..
    I will do that at the earliest as I require something else..

  7. #7
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Sorry MarvinP,

    I actually should have uploaded a worksheet earlier but the problem is that Im actually working on several things and getting mixed up and tired..

    ANyways, PFA..

    There's a Main List which is SORTED and I need to get a RANDOM list with the same no of elements as the first list, then from the RANDOM list I need to again SORT using the formula , this I require is for completely Automating a File where Data would be fed and that would be RANDOMly enterd and from that I need the SORTED List..

    Warm REgards
    e4excel
    Attached Files Attached Files

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Hi e4,

    I just don't get it. You want to randomize the list on the left to get the center list and then sort the center list to get the list on the left again? As soon as you sort the list on the right to have City and code it will be just like the left table. Won't it?

  9. #9
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Dear marvinp,

    No that was for your example.
    In the actual example I would have a Random List..in the beginnig itself..

    But as I want to randomize too for some other file which is almost similar I combined both the things in the list...

    Please look it as a Requirement in this format but I need the RANDOMIZING feature with the specifications of an Lower & Upper Limits without any Repeats and then If I can also SORT..

    Warm Regards
    e4excel
    Last edited by e4excel; 03-14-2012 at 01:53 AM.

  10. #10
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Bump No Response

    Bump No Response

  11. #11
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    E4, try this

    Insert two rows above, then use a helper column eg: column E in the first list & use,

    =IF(C5="","",RAND())

    copy down.

    In I1 enter =COUNT(E:E) to get total used towns.

    In the 2nd list use,

    =IF(ROWS(G$5:G5)<=I$1,INDEX(A:A,MATCH(SMALL(E:E,ROWS(G$5:G5)),E:E,0)),"")

    copy down.

    As Marvin Said, If the first list is already sorted, 3rd list will be exactly same as first list.

    See the attached. Hope this helps
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  12. #12
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Thanks Haseeb,

    Before I could get an answer I was searching for this Random without repeats and came across a solution by one of the gtreats either DonkeyOte or DaddyLongLegs..I am not sure..

    Just felt like sharing that as well as it is without using a Helper Column...

    I am uploading t he same file with the Solution in the Sheet "SomeFinding"
    the code gives a Random no from 1 till 5 without repeats columnwise..

    Please see...!

    Warm regards
    e4excel
    Attached Files Attached Files

  13. #13
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    Hi e4excel,

    Have you been able to apply your above CSE fomula to 200+ rows and then resorted them by the City? I'd love to see your final answer using the formula you have supplied from the above. I'm not sure the CSE formula you suggest from DO or DLL would fit in a cell. I also suspect you would need to know the exact number of rows or columns you were dealing with and your original question of "200+" rows implies the number might vary, making the formula not appropriate. If the answers supplied answer your question you can mark this one solved. I believe you have asked a question with an impossible answer. This reminds me of those questions that want a set of random numbers that must add up to a set sum. If the sum is defined then the numbers can't be completely random. I bellieve the question you asked doesn't have an answer, based on your stated criteria. Prove me wrong and use the CSE formula you found to solve your problem.

  14. #14
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Generating Random Numbers between Upper & Lower Limits and without Repeats.

    MarvinP,

    I never mentioned that Haseeb's solution did not serve my purpose but while I researching I had found something which can be of help to others refering the same query and nothing else..

    Maybe someone can still improvise that too if possible..

    So, please dont feel that I meant to disregard the already offered solution by Haseeb, if you go through my last post nowhere does it say that..

    Warm regards
    e4excel

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1