Thanks:  0
Likes:  0

# Thread: Lottery number generation: create a single line function.

1. 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 ]

2. how many balls in the lottery in uk??

3. 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.

4. 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.

5. 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().

6. 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...

7. 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 ]

8. Jack...

I dont see any formula

9. Hey ive goyt the ells and tripe on order,, wheres your formula>>

10. On 2002-03-30 12:57, Jack in the UK wrote:
Hey ive goyt the ells and tripe on order,, wheres your formula>>

Don't post anything man, that stuff's poison .

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•