Lottery number generation: create a single line function.

trillicomm

Board Regular
Joined
Feb 24, 2002
Messages
101
You must install "Analysis TookPak-VBA" before doing this; check in your Excel's Tools/Add-Ins menu. Paste this long function (see below) in an Excel's worksheet (any cell) and press F9 (calculate) until you see at least 2 identical numbers. Real life's lottery does not have repeating numbers. I can disable this repetition by using cells relation but I want to use just one (1) cell. Any expert wants to challenge? If not, you can use VBA. But it still requires one (1) line of codes.

=RANDBETWEEN(1,50)&" "&RANDBETWEEN(1,50)&" "&RANDBETWEEN(1,50)&" "&RANDBETWEEN(1,50)&" "&RANDBETWEEN(1,50)&" "&RANDBETWEEN(1,50)

T. Le
This message was edited by trillicomm on 2002-03-29 13:08
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Jack : 49 balls, 6 winners

I was looking at this lastnight and concluded it's not possible via a single formula. If anyone proves me wrong, I'll eat jellied eels and tripe for lunch for a month !

VBA is a different matter though, I wouldn't like to stick my neck out on that one.
 
Upvote 0
To make it easier, imagine a 2-number lottery string. I am trying to think of a way to compare the first and second number within the same cell.
 
Upvote 0
On 2002-03-29 12:36, trillicomm wrote:
You must install "Analysis TookPak-VBA" before doing this; check in your Excel's Tools/Add-Ins menu. Paste this long function (see below) in an Excel's worksheet (any cell) and press F9 (calculate) until you see at least 2 identical numbers. Real life's lottery does not have repeating numbers. I can disable this repetition by using cells relation but I want to use just one (1) cell. Any expert wants to challenge? If not, you can use VBA. But it still requires one (1) line of codes.

=RANDBETWEEN(1,50)&" "&RANDBETWEEN(1,50)&" "&RANDBETWEEN(1,50)&" "&RANDBETWEEN(1,50)&" "&RANDBETWEEN(1,50)&" "&RANDBETWEEN(1,50)

T. Le
This message was edited by trillicomm on 2002-03-29 13:08

I'm racking my brains here, this is an interesting question.
Can you expand on what you mean by:

If not, you can use VBA. But it still requires one (1) line of codes.

Just 1. I cant see that it makes much difference, the Function on the sheet would still only be 1 cell, say =LOTTERY().
 
Upvote 0
As long as VBA also has 1 line, too. I can do this in VBA with multiple lines of codes. But that's too easy.

I am plugging my hair to come up with a way to assign a variable to each randbetween. Is that possible? Hmmm...
 
Upvote 0
Children listen... i have this one sussed top to bottom

Dave Hawley my old pal NO YOU CANT POST even Anno!

surprised aladins not having a say...

Ivan will solve it as wil Mark Obrian joe was old mat Mudfce and the Elephant and Castle man dk if im missed you no harm im sure you will to

The formula is no good for UK as we have ball 1 to 49 so that dont work??? no dramas lets get it right...

Chris i know Gangsters from the East End OK sadly my friends now passed on (yes if you guess your right the "wonderful brothers" but this is not the place for that ) but my point is ill buy you eels and tripe down whitechaple rd Bethnal Green for you and nasty tripe when i prove this one.

Or maybe better still post a beer to Ivan i owe him that! and a beed to aladin an Dave !!!

I have VBA which is cool that does this in a spredsheet really good.. remind me ill email it.. i have two...

Can a formula do this.. can i cheat?? OK no i wont udf this but formula... YES it can i have such..... works first time ever time. MY Fininacial Director was going to sack me when i got caught doing this test, then i email her now we are kinda pals!

Come on boys... Chris i spoken to a butcher in Tooting Market Tripe 100 kilos with your name on UNCOOKED!!!!




_________________
Good Luck
HTH

Rdgs
==========
Jack in the UK
This message was edited by Jack in the UK on 2002-03-30 13:12
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,183
Members
448,872
Latest member
lcaw

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