The most pointless combination of functions

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
=IF(RANDBETWEEN(1,3)=1,1,IF(RANDBETWEEN(1,3)=2,2,IF(RANDBETWEEN(1,3)=3,3,RANDBETWEEN(1,3))))

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
For those of you who are interested in the statistics, I created a list of 5000 of the above formula and counted the frequency of 1s, 2s and 3s. I repeated this 20 times and got the following results:
<o:p> </o:p>
Average percentage of 1s: 43.143%
Average percentage of 2s: 32.184%
Average percentage of 3s: 24.673%
<o:p> </o:p>
Standard Deviation of 1s: 0.006262
Standard Deviation of 2s: 0.006368
Standard Deviation of 3s: 0.005044
<o:p> </o:p>
Total variation of percentages (highest percentage minus lowest percentage)
1s: 2.12%
2s: 2.52%
3s: 2.12%
<o:p> </o:p>
Conclusion……This seems to be a fairly consistently distributed random function!!!
 
Barry - can I be a geek, and ask how you worked out the distribution of 1s, 2s and 3s, please. Because I just spent 10 minutes creating a nice little tree, and I'm sure there must be a better way. But A level stats was a long time ago... Only if you haven't taken your tablet yet, obviously ;)

I've only taken the little blue one so I'm OK for now.......

I think Gerald's done it for you but obviously I used 81 to keep to whole numbers.

Run the formula 81 times and 27 times the 1st Randbetween generates 1, formula over

For the 54 times that 1st RB generates 2 or 3, 2nd RB is brought in to play and 54/3 = 18 2s, formula over

For the remaining 36 times that RB #3 runs we get 36/3 = 12 3s, formula over

Then 24 times RB 4 is called there are 8 each of 1 , 2 and 3

so the totals are

1 - 27+8 =35 = 43.21%
2 - 18+8 =26 = 32.10%
3 - 12+8 =20 = 24.69%

Edit: which almost exactly matches the distribution that Lewiy experienced
 
Last edited:
Its now clear that I have generated a pointless explaination of a pointless distibution generated by a pointless statement.

Sorry.

Thanks for explaining though - Its all a bit cleared now and i will try to avoid calling rand() functions multiple times within the same function.
 
Yeah, I realised when Gerald posted that that method wasn't actually as involved as I had thought when I gave up on it ;)
 
kgkev - I, at least, enjoyed the discussion. And I don't think you need to apologise for inanities in the Lounge - I'm in trouble otherwise!
 
Is this pointless?

=0

Is it a formula?:eek:
 

Forum statistics

Threads
1,222,682
Messages
6,167,603
Members
452,122
Latest member
Warwick89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top