+ Reply to Thread
Results 1 to 5 of 5

Excel generate random number with frequency

  1. #1
    Registered User
    Join Date
    05-03-2012
    Location
    Belgium Limburg
    MS-Off Ver
    Excel 2010
    Posts
    3

    Excel generate random number with frequency

    Hi,

    I'm having some trouble with the following question.
    I need to generate 140 numbers between 1 and 80.
    The diffecult part is, I need a frequency of 66.67% for numbers between 1 and 40 and 33.33% for numbers between 41 and 80...
    I do have the analystic toolkit installed and I know how to work with these functions... I just don't know how to make this work.

    Any help is appreciated!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,794

    Re: Excel generate random number with frequency

    Generate a random number between 1 and 40 and add onto it another random number between 1 and 40.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    05-03-2012
    Location
    Belgium Limburg
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel generate random number with frequency

    Quote Originally Posted by Pete_UK View Post
    Generate a random number between 1 and 40 and add onto it another random number between 1 and 40.

    Hope this helps.

    Pete
    Hi Pete and thanks for the tip.

    I was hoping to this could be solves with a build-in function or with a function from the analystic toolkit.
    The thing is, I am a student in IT and I am required to work with some functions like randbetween, etc...

    My first idea was to generate these number with randbetween and give this as a parameter.
    Column A Column B
    1<41 66,67%
    40<81 33,33%

    But of course, Excel doesn't take Column A as parameters...
    Any tips on how I should accomplish this???

  4. #4
    Registered User
    Join Date
    05-03-2012
    Location
    Belgium Limburg
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel generate random number with frequency

    I was hoping this would be a routine job?
    Is there nobody who can help me with this?

    I don't want to be pushy, but my course material isn't as clear about this as it could be...

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,794

    Re: Excel generate random number with frequency

    Well, isn't:

    =RANDBETWEEN(1,40)+RANDBETWEEN(1,40)

    a formula that involves RANDBETWEEN?

    Anyway, I've just put that in a sheet for 80 cells, with a couple of COUNTIF formulae to count the number below and above 40 and it seems to be centred on a 40:40 split, so maybe that isn't the right approach anyway.

    Another approach would be to generate 1-40 in the first third of your cells and then 1-80 in the remainder of the cells - assume you start in A1 and let's take row 27 as the start of the second third, then you could try this:

    =RANDBETWEEN(1,40*(2-(ROW()<27)))

    There are other ways (as always with Excel) - I would have thought that your course material is designed to make you THINK about the solution, rather than give it to you on a plate like I've done.

    Hope this helps.

    Pete (a former lecturer)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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