Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As a beginner with Excel and VBA I have the following problem. I do kee
track of lottery numbers in a sheet. Don't ask me why. It doesn't help me win a big price. There is a dra of six numbers every week, from 1 to 45. I keep them in six collumns. From the year 1996 to this week. I'd like t seek combinations of numbers, say 2 or 3 numbers. If I, for example seek 3 numbers, 4-5-12 then they should sho up highlighted or coloured or whatever, if they excist in that combination. Or else give a statement that th combination doesn't excist. I have tried something with conditional formating but I can't seem t get that to do what I want. Is there anybody who can give me a hint!! -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should be easy, but need a bit more information as I don't know much
about lotteries. Does the order of the numbers matter? Does it matter in which columns the numbers are (there are 6 columns, but you mention 3 numbers)? RBS "knoertje " wrote in message ... As a beginner with Excel and VBA I have the following problem. I do keep track of lottery numbers in a sheet. Don't ask me why. It doesn't help me win a big price. There is a draw of six numbers every week, from 1 to 45. I keep them in six collumns. From the year 1996 to this week. I'd like to seek combinations of numbers, say 2 or 3 numbers. If I, for example seek 3 numbers, 4-5-12 then they should show up highlighted or coloured or whatever, if they excist in that combination. Or else give a statement that the combination doesn't excist. I have tried something with conditional formating but I can't seem to get that to do what I want. Is there anybody who can give me a hint!!! --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Let's say your lottery numbers for the last 52 weeks are in A3:F54. In A1:C1
you put the three numbers you're looking for. Then select A3:F54, with A3 the active cell. Go to Format/Conditional Formatting, select Formula Is in the 1st dropdown, and type this for the formula =AND(ISNUMBER(MATCH($A$1,$A3:$F3,0)),ISNUMBER(MATC H($B$1,$A3:$F3,0)), ISNUMBER(MATCH($C$1,$A3:$F3,0))) That all goes on one line, of course. Then select a format. On Fri, 30 Jul 2004 16:07:00 -0500, knoertje wrote: As a beginner with Excel and VBA I have the following problem. I do keep track of lottery numbers in a sheet. Don't ask me why. It doesn't help me win a big price. There is a draw of six numbers every week, from 1 to 45. I keep them in six collumns. From the year 1996 to this week. I'd like to seek combinations of numbers, say 2 or 3 numbers. If I, for example seek 3 numbers, 4-5-12 then they should show up highlighted or coloured or whatever, if they excist in that combination. Or else give a statement that the combination doesn't excist. I have tried something with conditional formating but I can't seem to get that to do what I want. Is there anybody who can give me a hint!!! --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I do have the numbers in column B5 to H5, which actually make it seve
numbers. The latest numbers are inserted in Row 5 every time, because of other formulas. So the latest is alway on top starting in B5. The order of the numbers in the combination I'm looking for don't matter. So my meanin is to give Excel 2 or 3 or 4 numbers and let Excel find if that combination of 2, 3 or 4 numbers excist. If tha combination excist I want Excel to highlight or color the combination in the sheet or tell me that i excist. But if that combination doesn't excist I want it to either do nothing or give a message or so . The formula given don't seem to work after adjusting it to my columns -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK. The best solution here would probably a VBA routine.
Will have a look at this later. RBS "knoertje " wrote in message ... I do have the numbers in column B5 to H5, which actually make it seven numbers. The latest numbers are inserted in Row 5 every time, because of other formulas. So the latest is always on top starting in B5. The order of the numbers in the combination I'm looking for don't matter. So my meaning is to give Excel 2 or 3 or 4 numbers and let Excel find if that combination of 2, 3 or 4 numbers excist. If that combination excist I want Excel to highlight or color the combination in the sheet or tell me that it excist. But if that combination doesn't excist I want it to either do nothing or give a message or so . The formula given don't seem to work after adjusting it to my columns. --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The best solution is probably conditional formatting.
-- Regards, Tom Ogilvy "RB Smissaert" wrote in message ... OK. The best solution here would probably a VBA routine. Will have a look at this later. RBS "knoertje " wrote in message ... I do have the numbers in column B5 to H5, which actually make it seven numbers. The latest numbers are inserted in Row 5 every time, because of other formulas. So the latest is always on top starting in B5. The order of the numbers in the combination I'm looking for don't matter. So my meaning is to give Excel 2 or 3 or 4 numbers and let Excel find if that combination of 2, 3 or 4 numbers excist. If that combination excist I want Excel to highlight or color the combination in the sheet or tell me that it excist. But if that combination doesn't excist I want it to either do nothing or give a message or so . The formula given don't seem to work after adjusting it to my columns. --- Message posted from http://www.ExcelForum.com/ |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
OK; I am not going to argue with that. RBS "Tom Ogilvy" wrote in message ... The best solution is probably conditional formatting. -- Regards, Tom Ogilvy "RB Smissaert" wrote in message ... OK. The best solution here would probably a VBA routine. Will have a look at this later. RBS "knoertje " wrote in message ... I do have the numbers in column B5 to H5, which actually make it seven numbers. The latest numbers are inserted in Row 5 every time, because of other formulas. So the latest is always on top starting in B5. The order of the numbers in the combination I'm looking for don't matter. So my meaning is to give Excel 2 or 3 or 4 numbers and let Excel find if that combination of 2, 3 or 4 numbers excist. If that combination excist I want Excel to highlight or color the combination in the sheet or tell me that it excist. But if that combination doesn't excist I want it to either do nothing or give a message or so . The formula given don't seem to work after adjusting it to my columns. --- Message posted from http://www.ExcelForum.com/ |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
in my country we have a lottery of 5 numbers out of 42.
I use Access to store the data for past draws and then make a number of different analysis. In my opinion Access is a better tool then a spreadsheet to keep data. Vince -----Original Message----- As a beginner with Excel and VBA I have the following problem. I do keep track of lottery numbers in a sheet. Don't ask me why. It doesn't help me win a big price. There is a draw of six numbers every week, from 1 to 45. I keep them in six collumns. From the year 1996 to this week. I'd like to seek combinations of numbers, say 2 or 3 numbers. If I, for example seek 3 numbers, 4-5-12 then they should show up highlighted or coloured or whatever, if they excist in that combination. Or else give a statement that the combination doesn't excist. I have tried something with conditional formating but I can't seem to get that to do what I want. Is there anybody who can give me a hint!!! --- Message posted from http://www.ExcelForum.com/ . |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Unless you want to look at more than 65 thousand old
numbers, I can't see much wrong with a spreadsheet. It all depends on what you are most familiar with. RBS wrote in message ... in my country we have a lottery of 5 numbers out of 42. I use Access to store the data for past draws and then make a number of different analysis. In my opinion Access is a better tool then a spreadsheet to keep data. Vince -----Original Message----- As a beginner with Excel and VBA I have the following problem. I do keep track of lottery numbers in a sheet. Don't ask me why. It doesn't help me win a big price. There is a draw of six numbers every week, from 1 to 45. I keep them in six collumns. From the year 1996 to this week. I'd like to seek combinations of numbers, say 2 or 3 numbers. If I, for example seek 3 numbers, 4-5-12 then they should show up highlighted or coloured or whatever, if they excist in that combination. Or else give a statement that the combination doesn't excist. I have tried something with conditional formating but I can't seem to get that to do what I want. Is there anybody who can give me a hint!!! --- Message posted from http://www.ExcelForum.com/ . |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just wondering if after all this you got it to work, either with the
formula's or with VBA. RBS "knoertje " wrote in message ... As a beginner with Excel and VBA I have the following problem. I do keep track of lottery numbers in a sheet. Don't ask me why. It doesn't help me win a big price. There is a draw of six numbers every week, from 1 to 45. I keep them in six collumns. From the year 1996 to this week. I'd like to seek combinations of numbers, say 2 or 3 numbers. If I, for example seek 3 numbers, 4-5-12 then they should show up highlighted or coloured or whatever, if they excist in that combination. Or else give a statement that the combination doesn't excist. I have tried something with conditional formating but I can't seem to get that to do what I want. Is there anybody who can give me a hint!!! --- Message posted from http://www.ExcelForum.com/ |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No, not yet. I'm busy truying to get it to work, but it does only a fe
lines of checking. And it takes a long time. But I keep trying. I wi attach a zip file with what I have so far. I trying to choose between or 3 or 4 number combinations. For example: I want to find out if 10 an 20 excist in combination with each other. Or if 2 and 12 and 37 exist i combination with each other. And if they do, how often. Or even a fou numbered combination. I don't know if it is possible in Excel, bu that's what I had in mind. And maybe I get there someday. And by th way.....thanks for the time and effort you have put into it Attachment filename: testlotto.zip Download attachment: http://www.excelforum.com/attachment.php?postid=63726 -- Message posted from http://www.ExcelForum.com |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't understand.
Have tested comparing a combination of 7 numbers with 35000 other 7 number combinations. This took about 1.5 secs. This is on a fast computer, but still. If you want I send you the workbook. RBS "knoertje " wrote in message ... No, not yet. I'm busy truying to get it to work, but it does only a few lines of checking. And it takes a long time. But I keep trying. I wil attach a zip file with what I have so far. I trying to choose between 2 or 3 or 4 number combinations. For example: I want to find out if 10 and 20 excist in combination with each other. Or if 2 and 12 and 37 exist in combination with each other. And if they do, how often. Or even a four numbered combination. I don't know if it is possible in Excel, but that's what I had in mind. And maybe I get there someday. And by the way.....thanks for the time and effort you have put into it. Attachment filename: testlotto.zip Download attachment: http://www.excelforum.com/attachment.php?postid=637263 --- Message posted from http://www.ExcelForum.com/ |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It would be nice to take a look at that workbook. As you understand I'
just beginning with Excel and VBA. So learning from some code is alway a good option -- Message posted from http://www.ExcelForum.com |
#14
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok, not sure though what the e-mail address is.
RBS "knoertje " wrote in message ... It would be nice to take a look at that workbook. As you understand I'm just beginning with Excel and VBA. So learning from some code is always a good option. --- Message posted from http://www.ExcelForum.com/ |
#15
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello RB Smissaert,
Hope you don't mind me resurrecting this August 2004, Posting from Excelforum.com/attachment.php?postid=637263 - regarding "combination of numbers in lottery" dated 8/7/2004. I have a similar requirement and if you do not mind I would appreciate a copy of the Excel spreadsheet you created for MJ - knoertje, if still available. Thanks Tina "RB Smissaert" wrote: Don't understand. Have tested comparing a combination of 7 numbers with 35000 other 7 number combinations. This took about 1.5 secs. This is on a fast computer, but still. If you want I send you the workbook. RBS "knoertje " wrote in message ... No, not yet. I'm busy truying to get it to work, but it does only a few lines of checking. And it takes a long time. But I keep trying. I wil attach a zip file with what I have so far. I trying to choose between 2 or 3 or 4 number combinations. For example: I want to find out if 10 and 20 excist in combination with each other. Or if 2 and 12 and 37 exist in combination with each other. And if they do, how often. Or even a four numbered combination. I don't know if it is possible in Excel, but that's what I had in mind. And maybe I get there someday. And by the way.....thanks for the time and effort you have put into it. Attachment filename: testlotto.zip Download attachment: http://www.excelforum.com/attachment.php?postid=637263 --- Message posted from http://www.ExcelForum.com/ |
#16
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bart,
Thanks for file. Tina "Tina" wrote: Hello RB Smissaert, Hope you don't mind me resurrecting this August 2004, Posting from Excelforum.com/attachment.php?postid=637263 - regarding "combination of numbers in lottery" dated 8/7/2004. I have a similar requirement and if you do not mind I would appreciate a copy of the Excel spreadsheet you created for MJ - knoertje, if still available. Thanks Tina "RB Smissaert" wrote: Don't understand. Have tested comparing a combination of 7 numbers with 35000 other 7 number combinations. This took about 1.5 secs. This is on a fast computer, but still. If you want I send you the workbook. RBS "knoertje " wrote in message ... No, not yet. I'm busy truying to get it to work, but it does only a few lines of checking. And it takes a long time. But I keep trying. I wil attach a zip file with what I have so far. I trying to choose between 2 or 3 or 4 number combinations. For example: I want to find out if 10 and 20 excist in combination with each other. Or if 2 and 12 and 37 exist in combination with each other. And if they do, how often. Or even a four numbered combination. I don't know if it is possible in Excel, but that's what I had in mind. And maybe I get there someday. And by the way.....thanks for the time and effort you have put into it. Attachment filename: testlotto.zip Download attachment: http://www.excelforum.com/attachment.php?postid=637263 --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to calculate frequency of lottery numbers? | New Users to Excel | |||
How to calculate frequency of lottery numbers? | New Users to Excel | |||
Bingo Lottery Winning Numbers | Excel Discussion (Misc queries) | |||
Checking Winning Numbers in the Lottery. | Excel Discussion (Misc queries) | |||
complex validation for lottery numbers | Excel Discussion (Misc queries) |