+ Reply to Thread
Results 1 to 9 of 9

place alphabet randomly in cells?

  1. #1
    Registered User
    Join Date
    12-21-2008
    Location
    malaysia
    Posts
    14

    place alphabet randomly in cells?

    Is it possible to place the limited amount of same number/alphabet in a given numbers of cells?

    For example I want to have 5 same alphabets to be placed randomly in 15 cells for the same row. Can it be done?
    Attached Images Attached Images

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I'm a litle clueless as to what your trying to do, but maybe in B1 and copy down,

    =if(rand() < 0.3, "a", "")
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    12-21-2008
    Location
    malaysia
    Posts
    14
    As in in 1 column i select 20 rows/cells in that column..i would like excel to place 5 A randomly in that 20 cells. Placing of the alphabet has to be done randomly.

    Is that possible?
    Last edited by Excript; 12-22-2008 at 12:59 AM.

  4. #4
    Forum Contributor
    Join Date
    11-23-2005
    Location
    Perth, Australia
    Posts
    218

    Is it possible to place alphabet randomly in cells?

    Also a way in vba would be something like(in a standard module) :

    Please Login or Register  to view this content.
    If neither of these solutions are what you are after maybe some more clarification is needed..

    Hope this helps!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You want to place exactly 5 a's in B1:B20 starting in B1?

  6. #6
    Registered User
    Join Date
    12-21-2008
    Location
    malaysia
    Posts
    14
    Quote Originally Posted by shg View Post
    You want to place exactly 5 a's in B1:B20 starting in B1?
    Yes, I want it to be placed randomly in B1 to B20 starting in B1 and only 5 A's

    Can it be done?

    Thanks for your help in advance

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    In B1: =IF(RAND() <= 0.2, "a", "")

    In B2 and copy down to B20: =IF(RAND() < (5 - COUNTIF(B$1:B1, "a") )/ (21 - ROW()), "a", "")

  8. #8
    Registered User
    Join Date
    12-21-2008
    Location
    malaysia
    Posts
    14
    Shg Thanks for finding me that formula but I do have a question.

    I noticed that the formula runs its course again when I filter the alphabets.
    Is there anyway to fix it?

    Like I would like to filter all the blank cells and show only the random alphabets but once i do that, it will randomly place it again.

    Thanks.
    Last edited by Excript; 12-22-2008 at 09:53 PM.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I noticed that the formula runs its course again when I filter the alphabets.
    Is there anyway to fix it?

    Like I would like to filter all the blank cells and show only the random alphabets but once i do that, it will randomly place it again.
    I'm sorry, I don't understand any of that.

    Maybe you could add the formula, copy the results, and paste over itself as values.

+ 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