<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: VBA Random Integers</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:42:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Busybee</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/#comment-40335</link>
		<dc:creator>Busybee</dc:creator>
		<pubDate>Fri, 24 Jul 2009 06:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2713#comment-40335</guid>
		<description>&lt;p&gt;@Tushar&lt;/p&gt;
&lt;p&gt;I did go thru the page.. am just confused newbie...will it work as a worksheet function ?&lt;/p&gt;
&lt;p&gt;I am just not sure which is one is right for me :-(&lt;/p&gt;
&lt;p&gt;Thx in advance.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Tushar</p>
<p>I did go thru the page.. am just confused newbie&#8230;will it work as a worksheet function ?</p>
<p>I am just not sure which is one is right for me <img src='http://www.dailydoseofexcel.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>Thx in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/#comment-40334</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Fri, 24 Jul 2009 05:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2713#comment-40334</guid>
		<description>&lt;p&gt;Busybee:&lt;/p&gt;
&lt;p&gt;See&lt;/p&gt;
&lt;p&gt;Select elements at random without repetition&lt;br&gt;
&lt;a href=&quot;http://www.tushar-mehta.com/excel/newsgroups/rand_selection/&quot; rel=&quot;nofollow&quot;&gt;http://www.tushar-mehta.com/excel/newsgroups/rand_selection/&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Busybee:</p>
<p>See</p>
<p>Select elements at random without repetition<br />
<a href="http://www.tushar-mehta.com/excel/newsgroups/rand_selection/" rel="nofollow">http://www.tushar-mehta.com/excel/newsgroups/rand_selection/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Busybee</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/#comment-40331</link>
		<dc:creator>Busybee</dc:creator>
		<pubDate>Fri, 24 Jul 2009 02:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2713#comment-40331</guid>
		<description>&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;Does this give unique random or there are repeats ??&lt;/p&gt;
&lt;p&gt;I am looking @ creating a Quizz which pick unique random questions from different sections,however this below picks up repeats tooo&lt;/p&gt;
&lt;p&gt;For j = 1 To SA&lt;br&gt;
    RD = WorksheetFunction.RandBetween(2, ACount)&lt;br&gt;
    Worksheets(&quot;Quiz Paper&quot;).Cells(j + 10, 1) = Worksheets(&quot;Section A&quot;).Cells(RD, 1)&lt;br&gt;
    Worksheets(&quot;Quiz Paper&quot;).Cells(j + 10, 2) = Worksheets(&quot;Section A&quot;).Cells(RD, 2)&lt;br&gt;
    Worksheets(&quot;Quiz Paper&quot;).Cells(j + 10, 3) = &quot;Section A&quot;&lt;br&gt;
    Worksheets(&quot;Quiz Paper&quot;).Cells(j + 10, 4) = Worksheets(&quot;Section A&quot;).Cells(RD, 3)&lt;br&gt;
Next j&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>Does this give unique random or there are repeats ??</p>
<p>I am looking @ creating a Quizz which pick unique random questions from different sections,however this below picks up repeats tooo</p>
<p>For j = 1 To SA<br />
    RD = WorksheetFunction.RandBetween(2, ACount)<br />
    Worksheets(&#8220;Quiz Paper&#8221;).Cells(j + 10, 1) = Worksheets(&#8220;Section A&#8221;).Cells(RD, 1)<br />
    Worksheets(&#8220;Quiz Paper&#8221;).Cells(j + 10, 2) = Worksheets(&#8220;Section A&#8221;).Cells(RD, 2)<br />
    Worksheets(&#8220;Quiz Paper&#8221;).Cells(j + 10, 3) = &#8220;Section A&#8221;<br />
    Worksheets(&#8220;Quiz Paper&#8221;).Cells(j + 10, 4) = Worksheets(&#8220;Section A&#8221;).Cells(RD, 3)<br />
Next j</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/#comment-40321</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Thu, 23 Jul 2009 00:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2713#comment-40321</guid>
		<description>&lt;p&gt;Dick wrote: &quot;Because I&#039;m using Round(), it will only pick the edges ~50% as often as the middle numbers. It seems that if I simply increase my range, that is reduce dLow by 0.5 and increase dHigh by .49, my distribution will be right. Technically it won&#039;t be right, but it will be close enough for government work. Whereas the old method wasn&#039;t even close enough for that.&quot;&lt;/p&gt;
&lt;p&gt;So, why not just use INT in Excel or Int in VBA and get the correct result in the first place -- subject, of course, to the limitations in RAND (or Rnd).  It&#039;s a lot easier than trying to fudge ROUND/Round. {grin}&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dick wrote: &#8220;Because I&#8217;m using Round(), it will only pick the edges ~50% as often as the middle numbers. It seems that if I simply increase my range, that is reduce dLow by 0.5 and increase dHigh by .49, my distribution will be right. Technically it won&#8217;t be right, but it will be close enough for government work. Whereas the old method wasn&#8217;t even close enough for that.&#8221;</p>
<p>So, why not just use INT in Excel or Int in VBA and get the correct result in the first place &#8212; subject, of course, to the limitations in RAND (or Rnd).  It&#8217;s a lot easier than trying to fudge ROUND/Round. {grin}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/#comment-40313</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Wed, 22 Jul 2009 13:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2713#comment-40313</guid>
		<description>&lt;p&gt;they&#039;re all biased!  use this: &lt;a href=&quot;http://www.random.org/clients/http/&quot; rel=&quot;nofollow&quot;&gt;http://www.random.org/clients/http/&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>they&#8217;re all biased!  use this: <a href="http://www.random.org/clients/http/" rel="nofollow">http://www.random.org/clients/http/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Jenkins</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/#comment-40307</link>
		<dc:creator>Doug Jenkins</dc:creator>
		<pubDate>Wed, 22 Jul 2009 02:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2713#comment-40307</guid>
		<description>&lt;p&gt;According to &quot;Excel for Scientists and Engineers&quot; (E. Joseph Billo) a new algorithm for random numbers was introduced in Excel 2003, because the old one wasn&#039;t very good.  Does anyone know if VBA uses the new algorithm or the old one (or something different)?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>According to &#8220;Excel for Scientists and Engineers&#8221; (E. Joseph Billo) a new algorithm for random numbers was introduced in Excel 2003, because the old one wasn&#8217;t very good.  Does anyone know if VBA uses the new algorithm or the old one (or something different)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jayson</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/#comment-40305</link>
		<dc:creator>Jayson</dc:creator>
		<pubDate>Tue, 21 Jul 2009 19:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2713#comment-40305</guid>
		<description>&lt;p&gt;@JoshG&lt;/p&gt;
&lt;p&gt;Thanks for the explanation. Good stuff to know.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@JoshG</p>
<p>Thanks for the explanation. Good stuff to know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JoshG</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/#comment-40304</link>
		<dc:creator>JoshG</dc:creator>
		<pubDate>Tue, 21 Jul 2009 19:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2713#comment-40304</guid>
		<description>&lt;p&gt;Speed is one big advantage to writing your own.  A few quick tests on my machine showed that my random function (like fzz&#039;s) is about 30-50 times faster than using the RandBetween Worksheetfunction.  Also, previous to 2007 (at least in 2003), you needed to have the Analysis Tool Pak installed for RandBetween.  Writing your own function helps improve compatibility.  &lt;/p&gt;
&lt;p&gt;-Josh&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Speed is one big advantage to writing your own.  A few quick tests on my machine showed that my random function (like fzz&#8217;s) is about 30-50 times faster than using the RandBetween Worksheetfunction.  Also, previous to 2007 (at least in 2003), you needed to have the Analysis Tool Pak installed for RandBetween.  Writing your own function helps improve compatibility.  </p>
<p>-Josh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jayson</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/#comment-40301</link>
		<dc:creator>Jayson</dc:creator>
		<pubDate>Tue, 21 Jul 2009 17:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2713#comment-40301</guid>
		<description>&lt;p&gt;So, I&#039;m really curious now.  Why go through all the trouble of creating a random function when one exists?  Is the built in function RANDBETWEEN biased? Are there advantages to building your own?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>So, I&#8217;m really curious now.  Why go through all the trouble of creating a random function when one exists?  Is the built in function RANDBETWEEN biased? Are there advantages to building your own?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/07/20/vba-random-integers/#comment-40300</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 21 Jul 2009 13:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2713#comment-40300</guid>
		<description>&lt;p&gt;Dick -&lt;/p&gt;
&lt;p&gt;fzz beat me to it, and Ross hinted at it first. &lt;/p&gt;
&lt;p&gt;Your second procedure is essentially calculating Low + Int(High - Low + 0.99)&lt;/p&gt;
&lt;p&gt;For an accountant, isn&#039;t that somewhat precise? I guess if you&#039;re an accountant for Enron, it&#039;s orders of magnitude too precise.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dick -</p>
<p>fzz beat me to it, and Ross hinted at it first. </p>
<p>Your second procedure is essentially calculating Low + Int(High &#8211; Low + 0.99)</p>
<p>For an accountant, isn&#8217;t that somewhat precise? I guess if you&#8217;re an accountant for Enron, it&#8217;s orders of magnitude too precise.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

