Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ian Engelbrecht
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default 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(A10.2;0;1)

HTH
--
AP

"Ian Engelbrecht" a écrit dans le message de
...
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   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default Generate column of 1's and 0's randomly

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

HTH
--
AP

"Ian Engelbrecht" a écrit dans le message de
...
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   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Generate column of 1's and 0's randomly

Good call. I like it!

Andy.

"Ardus Petus" wrote in message
...
One way to do it would be to add a staging column containing formula
=RAND()
On next column, enter formula =IF(A10.2;0;1)

HTH
--
AP

"Ian Engelbrecht" a écrit dans le message de
...
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   Report Post  
Posted to microsoft.public.excel.misc
Niek Otten
 
Posts: n/a
Default 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" wrote in message ...
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   Report Post  
Posted to microsoft.public.excel.misc
Ian Engelbrecht
 
Posts: n/a
Default 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" a écrit dans le message de
...
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!




  #7   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default Generate column of 1's and 0's randomly


....or even....

=(RAND()<0.2)+0


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=528597

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM
How to group similar column titles together???? vrk1 Excel Discussion (Misc queries) 2 April 30th 05 12:17 AM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


All times are GMT +1. The time now is 05:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"