+ Reply to Thread
Results 1 to 7 of 7

Generate column of 1's and 0's randomly

Hybrid View

Guest Generate column of 1's and... 03-31-2006, 12:00 PM
Guest Re: Generate column of 1's... 03-31-2006, 12:25 PM
Guest Re: Generate column of 1's... 03-31-2006, 12:30 PM
Guest Re: Generate column of 1's... 03-31-2006, 12:25 PM
Guest Re: Generate column of 1's... 04-01-2006, 08:35 AM
daddylonglegs ....or even.... ... 04-01-2006, 09:52 AM
Guest Re: Generate column of 1's... 03-31-2006, 12:40 PM
  1. #1
    Ian Engelbrecht
    Guest

    Generate column of 1's and 0's randomly

    Hi all, I would like to add a column to my spreadsheet with randomly
    generated 1's and 0's. I would like to be able to set the probability with
    which these are generated, eg each time the number is generated there is a
    20% probability that it will be 1, and 80% that it will be zero. Would
    appreciate it STACKS if someone could help me out!

  2. #2
    Ardus Petus
    Guest

    Re: Generate column of 1's and 0's randomly

    One way to do it would be to add a staging column containing formula =RAND()
    On next column, enter formula =IF(A1>0.2;0;1)

    HTH
    --
    AP

    "Ian Engelbrecht" <boehmei@yahoo.com> a écrit dans le message de
    news:A56AC43F-F5C5-48EC-9588-AC9DD236B5DF@microsoft.com...
    > Hi all, I would like to add a column to my spreadsheet with randomly
    > generated 1's and 0's. I would like to be able to set the probability

    with
    > which these are generated, eg each time the number is generated there is a
    > 20% probability that it will be 1, and 80% that it will be zero. Would
    > appreciate it STACKS if someone could help me out!




  3. #3
    Guest

    Re: Generate column of 1's and 0's randomly

    Good call. I like it!

    Andy.

    "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    news:eVDcv6NVGHA.1236@TK2MSFTNGP11.phx.gbl...
    > One way to do it would be to add a staging column containing formula
    > =RAND()
    > On next column, enter formula =IF(A1>0.2;0;1)
    >
    > HTH
    > --
    > AP
    >
    > "Ian Engelbrecht" <boehmei@yahoo.com> a écrit dans le message de
    > news:A56AC43F-F5C5-48EC-9588-AC9DD236B5DF@microsoft.com...
    >> Hi all, I would like to add a column to my spreadsheet with randomly
    >> generated 1's and 0's. I would like to be able to set the probability

    > with
    >> which these are generated, eg each time the number is generated there is
    >> a
    >> 20% probability that it will be 1, and 80% that it will be zero. Would
    >> appreciate it STACKS if someone could help me out!

    >
    >




  4. #4
    Ardus Petus
    Guest

    Re: Generate column of 1's and 0's randomly

    Even simpler (no staging column)
    =IF(RAND()>0.2,0,1)

    HTH
    --
    AP

    "Ian Engelbrecht" <boehmei@yahoo.com> a écrit dans le message de
    news:A56AC43F-F5C5-48EC-9588-AC9DD236B5DF@microsoft.com...
    > Hi all, I would like to add a column to my spreadsheet with randomly
    > generated 1's and 0's. I would like to be able to set the probability

    with
    > which these are generated, eg each time the number is generated there is a
    > 20% probability that it will be 1, and 80% that it will be zero. Would
    > appreciate it STACKS if someone could help me out!




  5. #5
    Ian Engelbrecht
    Guest

    Re: Generate column of 1's and 0's randomly

    Thanks a lot for the help folks, much appreciated!

    "Ardus Petus" wrote:

    > Even simpler (no staging column)
    > =IF(RAND()>0.2,0,1)
    >
    > HTH
    > --
    > AP
    >
    > "Ian Engelbrecht" <boehmei@yahoo.com> a écrit dans le message de
    > news:A56AC43F-F5C5-48EC-9588-AC9DD236B5DF@microsoft.com...
    > > Hi all, I would like to add a column to my spreadsheet with randomly
    > > generated 1's and 0's. I would like to be able to set the probability

    > with
    > > which these are generated, eg each time the number is generated there is a
    > > 20% probability that it will be 1, and 80% that it will be zero. Would
    > > appreciate it STACKS if someone could help me out!

    >
    >
    >


  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,721
    ....or even....

    =(RAND()<0.2)+0

  7. #7
    Niek Otten
    Guest

    Re: Generate column of 1's and 0's randomly

    In column A:
    =RANDBETWEEN(1,100)

    Fill down as far as needed

    In column B:
    =IF(RIGHT(A1,1)>"8",0,1) (of course "8" can be something else)

    Fill down

    --
    Kind regards,

    Niek Otten

    "Ian Engelbrecht" <boehmei@yahoo.com> wrote in message news:A56AC43F-F5C5-48EC-9588-AC9DD236B5DF@microsoft.com...
    > Hi all, I would like to add a column to my spreadsheet with randomly
    > generated 1's and 0's. I would like to be able to set the probability with
    > which these are generated, eg each time the number is generated there is a
    > 20% probability that it will be 1, and 80% that it will be zero. Would
    > appreciate it STACKS if someone could help me out!




+ 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