ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Generate all possible combinations from three data sets? (https://www.excelbanter.com/excel-programming/313018-generate-all-possible-combinations-three-data-sets.html)

Flamikey[_6_]

Generate all possible combinations from three data sets?
 

I want to build a table that lists all possible Blackjack initial han
combinations with a dealer and one player. This means I am onl
looking for the first 3 cards and I am making the assumption there is
full deck. So I have 3 sets of {2,3,4,5,6,7,8,9,10,J,Q,K,A} and ther
should be 2,197 possible combinations (suits are not considered). I
there an easy formula to generate all of the possible 2,197 hands?
Thanks

--
Flamike
-----------------------------------------------------------------------
Flamikey's Profile: http://www.excelforum.com/member.php...nfo&userid=461
View this thread: http://www.excelforum.com/showthread.php?threadid=26779


Rob van Gelder[_4_]

Generate all possible combinations from three data sets?
 
You want a permutation generator.

You could start with the one on J-Walk's site:
http://j-walk.com/ss/excel/tips/tip46.htm

With some work you might be able to get what you want.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Flamikey" wrote in message
...

I want to build a table that lists all possible Blackjack initial hand
combinations with a dealer and one player. This means I am only
looking for the first 3 cards and I am making the assumption there is a
full deck. So I have 3 sets of {2,3,4,5,6,7,8,9,10,J,Q,K,A} and there
should be 2,197 possible combinations (suits are not considered). Is
there an easy formula to generate all of the possible 2,197 hands?
Thanks.


--
Flamikey
------------------------------------------------------------------------
Flamikey's Profile:
http://www.excelforum.com/member.php...fo&userid=4612
View this thread: http://www.excelforum.com/showthread...hreadid=267790




Myrna Larson

Generate all possible combinations from three data sets?
 
You need VBA for this.

Go to the Google news group search, and get the message posted by me (Myrna
Larson) on Aug 31, 2004 in the microsoft.public.excel.worksheet.functions
group. It includes the necessary VBA code and instructions as to how to use
it. On your worksheet, you will need to set up a 54-cell vertical range on the
worksheet with C in the 1st cell, 3 in the 2nd, and your list of 52 cards
below, i.e. 4 copies of the list you included in your message. The hands will
be listed on a new worksheet.

I calculate 22,100 combinations of 52 things taken 3 at a time. That's the
number of hands, assuming that suit DOES matter. Since it doesn't matter to
you, you can use Data/Filter/Advanced Filter on the list of 22,100 hands to
get the unique ones.


On Fri, 8 Oct 2004 16:45:07 -0500, Flamikey
wrote:


I want to build a table that lists all possible Blackjack initial hand
combinations with a dealer and one player. This means I am only
looking for the first 3 cards and I am making the assumption there is a
full deck. So I have 3 sets of {2,3,4,5,6,7,8,9,10,J,Q,K,A} and there
should be 2,197 possible combinations (suits are not considered). Is
there an easy formula to generate all of the possible 2,197 hands?
Thanks.




All times are GMT +1. The time now is 01:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com