+ Reply to Thread
Results 1 to 6 of 6

Is range including a random generated number possible?!?! (Please help, urgent)

  1. #1
    Registered User
    Join Date
    01-12-2014
    Location
    Toronto
    MS-Off Ver
    microsoft 2010
    Posts
    4

    Is range including a random generated number possible?!?! (Please help, urgent)

    Hello, I'm new and currently DESPERATELY in need of some help. So here I go (this is for a simulation by the way):

    I have a number (eg. 38) that is calculated by a =countif formula of a specific number (eg. 4) generated from a =randbetween formula for however many rows (eg. 50)

    So, after this step, I need to generate a different set of numbers. I used =randbetween(1, 2) for two variables. The problem is, the range that I need needs to be between 1 and 38 (as the example). However, each time the set of numbers are different, therefore I cannot make 38 rows, and expect 38 to be the outcome from the =countif formula each time.

    If I need to know the total number of 1s there are for the second random generation and is within the range 1 and the total number of the first generation, how would I go about doing this?

    I have made a list that exceeds the number of possible outcomes, but the range is still different each time. So I figured that I could try (example) =countif(A2:A(H24), 1) expecting it to be like A2:A38 for the range, but that does not work... or should it? (h24 as in the cell that 38 is in).

    Please include alternative suggestions or "the right way" (you can do so while shaking your head at this inconpetent highschooler) if there are any. (there must be right????) Even a "nope, sorry, you're dead meat" is okay too. At least I know.

    I hope that this wouldn't be confusing, and I need an answer asap if possible. For a school project, I basically self taught myself with videos and simple instructions, but of course do not know the majority of it. So as a last resort, I came here for help. Thank you in advance!!

    and I realized my title isn't exactly the same as the content (I apolgize)
    Last edited by hachi; 01-12-2014 at 01:28 AM.

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

    Re: Is range including a random generated number possible?!?! (Please help, urgent)

    Hi hachi and welcome to the forum,

    I'm thinking you are looking for something like:

    =SUM(INDIRECT("A1:A"&RANDBETWEEN(1,COUNTA(A:A))))

    See the attached where I do a sum of a random number of numbers in a column.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    01-12-2014
    Location
    Toronto
    MS-Off Ver
    microsoft 2010
    Posts
    4

    Re: Is range including a random generated number possible?!?! (Please help, urgent)

    Thank you so much for replying MarvinP!

    I really really really (I could go on) appreciate your effort, but this isn't what I'm looking for, as the number is far too large. Since the probability of randomly generating 1 or 2 is about 0.5, I would expect somewhere around half the number of the first total. With my example that would be ~19...

    I tried it with my own spreadsheet, and the results were also huge. :/
    Last edited by hachi; 01-12-2014 at 01:59 AM.

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

    Re: Is range including a random generated number possible?!?! (Please help, urgent)

    Hi,

    You really need to supply a sample workbook for us to know what ranges you are talking about. Change the formulas in the A column to Random instead of RandBetween. Then see if you like the answer better. The whole point is that the formula not in the A column that uses a RandBetween number of cells in column A. You must have missed that formula. It has an INDIRECT in it to determine how many cells to use for the SUM.

    Also, I have no idea if you want Sum, Average, Standard Deviation or some other aggregate as I don't think you mentioned that part in the problem.

  5. #5
    Registered User
    Join Date
    01-12-2014
    Location
    Toronto
    MS-Off Ver
    microsoft 2010
    Posts
    4

    Re: Is range including a random generated number possible?!?! (Please help, urgent)

    Sorry if I wasn't clear. I was hesitant on uploading it as it is very messy.

    I thought that the random function (rand()?) only gives a number between 0 and 1? That would not be useful in my case. And understood that the indirect function was the important part, however I had no idea what it was. Can you please explain it?

    If I refer directly to my file, I am focusing on my lands (I11 to I16) and I want the total number of 1's from column U, but having a limited range from 1 to whatever number cell I12 is. A count of my criteria which is 1, I guess?

    Thanks!
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-12-2014
    Location
    Toronto
    MS-Off Ver
    microsoft 2010
    Posts
    4

    Re: Is range including a random generated number possible?!?! (Please help, urgent)

    I thought I'd include this to give you whole point of this instead of bits and pieces of information. Even though it's not related to excel. There's obviously no need for this... but I don't know.. to me it's better than numbers organized with a few words.

    gamelayout.jpg

    I am stuck at the first wooden planks which split the ball's path in half. (Disney was not my idea btw)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Pick Random Value from a Range (not including empty Cells)
    By ghoneim in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-22-2013, 04:46 AM
  2. random answers generated from a list
    By juicy fruit in forum Excel General
    Replies: 9
    Last Post: 04-11-2010, 07:22 AM
  3. Non-random numbers generated by excel's data analysis random gener
    By Allie in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-17-2005, 02:05 AM
  4. Replies: 2
    Last Post: 09-13-2005, 12:05 PM
  5. URGENT- Random Sample per range of data
    By Another Jennifer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-29-2005, 10:05 PM

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