MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 29th, 2002, 01:36 PM   #1
trillicomm
Board Regular
 
Join Date: Feb 2002
Posts: 95
Default

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 ]
trillicomm is offline   Reply With Quote
Old Mar 30th, 2002, 05:36 AM   #2
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,064
Default

how many balls in the lottery in uk??


__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old Mar 30th, 2002, 08:07 AM   #3
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

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.
Chris Davison is offline   Reply With Quote
Old Mar 30th, 2002, 11:24 AM   #4
trillicomm
Board Regular
 
Join Date: Feb 2002
Posts: 95
Default

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.
trillicomm is offline   Reply With Quote
Old Mar 30th, 2002, 11:34 AM   #5
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

Quote:
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().


__________________
"Have a good time......all the time"
Ian Mac
Ian Mac is offline   Reply With Quote
Old Mar 30th, 2002, 11:41 AM   #6
trillicomm
Board Regular
 
Join Date: Feb 2002
Posts: 95
Default

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...
trillicomm is offline   Reply With Quote
Old Mar 30th, 2002, 11:58 AM   #7
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,064
Default

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 ]
Jack in the UK is offline   Reply With Quote
Old Mar 30th, 2002, 12:48 PM   #8
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

Jack...

I dont see any formula
Chris Davison is offline   Reply With Quote
Old Mar 30th, 2002, 01:57 PM   #9
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,064
Default

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

__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old Mar 30th, 2002, 02:00 PM   #10
Mudface
MrExcel MVP
 
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
Default

Quote:
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 .
Mudface is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:33 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes