If Someone Feels up To The Task

CARBOB

Well-known Member
Joined
Jun 6, 2005
Messages
1,870
In the first image, in column A are values ranging from 000001-376992, they represent the combinations of a 5/36 lottery game. The combinations range from 1-2-3-4-5 to 32-33-34-35-36.

The lexi value for 1-2-3-4-5 = 000001
32-33-34-35-36 = 376992
I would love to have the ability to input the last 3,4 & 5 values of the lexi value, individually and have the macro calculate the corresponding combinations in the second image, starting in column A. I know this is a huge task and if no one feels up to the task, I will understand
Excel Workbook
ABCDEF
100000112345
200000212346
300000312347
400000412348
F5 COMBOS
Excel 2007
Cell Formulas
RangeFormula
A1=COMBIN(36,5)-IF(32-$B1>0,COMBIN(36-$B1,5),0)-IF(33-$C1>0,COMBIN(36-$C1,4),0)-IF(34-$D1>0,COMBIN(36-$D1,3),0)-IF(35-$E1>0,COMBIN(36-$E1,2),0)-IF(36-$F1>0,COMBIN(36-$F1,1))
A2=COMBIN(36,5)-IF(32-$B2>0,COMBIN(36-$B2,5),0)-IF(33-$C2>0,COMBIN(36-$C2,4),0)-IF(34-$D2>0,COMBIN(36-$D2,3),0)-IF(35-$E2>0,COMBIN(36-$E2,2),0)-IF(36-$F2>0,COMBIN(36-$F2,1))
A3=COMBIN(36,5)-IF(32-$B3>0,COMBIN(36-$B3,5),0)-IF(33-$C3>0,COMBIN(36-$C3,4),0)-IF(34-$D3>0,COMBIN(36-$D3,3),0)-IF(35-$E3>0,COMBIN(36-$E3,2),0)-IF(36-$F3>0,COMBIN(36-$F3,1))
A4=COMBIN(36,5)-IF(32-$B4>0,COMBIN(36-$B4,5),0)-IF(33-$C4>0,COMBIN(36-$C4,4),0)-IF(34-$D4>0,COMBIN(36-$D4,3),0)-IF(35-$E4>0,COMBIN(36-$E4,2),0)-IF(36-$F4>0,COMBIN(36-$F4,1))
Excel Workbook
ABCDEFGHIJK
1
212429331242934
312710311271032
412925321292533
51213153312131534
61217303612173132
Sheet2
Excel 2007
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I don't understand what's input and what's output on Sheet2.

EDIT: Do you just want to return the combination for a given lexical position? Or vice versa?
 
Last edited:
Upvote 0
I can give you either of the two items I mentioned in my edit, but don't understand if you want something different than that.
 
Upvote 0
I don't understand what's input and what's output on Sheet2.

EDIT: Do you just want to return the combination for a given lexical position? Or vice versa?

"Do you just want to return the combination for a given lexical position? Or vice versa? "

The combinations that match the input of the last 3 or 4 or 5 values.

last 3 values should produce appoximatelt 377 combinations; last 4 values should produce 37-38 combinations.
 
Upvote 0
The method makes lexical combinations in this order:

<TABLE style="WIDTH: 115pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=155><COLGROUP><COL style="WIDTH: 23pt; mso-width-source: userset; mso-width-alt: 1426" span=5 width=31><TBODY><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8 0.5pt; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; WIDTH: 23pt; HEIGHT: 12pt; BORDER-TOP: #ece9d8 0.5pt; BORDER-RIGHT: #ece9d8 0.5pt" class=xl27 height=16 width=31>C1</TD><TD style="BORDER-BOTTOM: #ece9d8 0.5pt; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; WIDTH: 23pt; BORDER-TOP: #ece9d8 0.5pt; BORDER-RIGHT: #ece9d8 0.5pt" class=xl28 width=31>C2</TD><TD style="BORDER-BOTTOM: #ece9d8 0.5pt; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; WIDTH: 23pt; BORDER-TOP: #ece9d8 0.5pt; BORDER-RIGHT: #ece9d8 0.5pt" class=xl28 width=31>C3</TD><TD style="BORDER-BOTTOM: #ece9d8 0.5pt; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; WIDTH: 23pt; BORDER-TOP: #ece9d8 0.5pt; BORDER-RIGHT: #ece9d8 0.5pt" class=xl28 width=31>C4</TD><TD style="BORDER-BOTTOM: #ece9d8 0.5pt; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; WIDTH: 23pt; BORDER-TOP: #ece9d8 0.5pt; BORDER-RIGHT: #ece9d8 0.5pt" class=xl28 width=31>C5</TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #ffff99; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl30 height=16 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #ffff99; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl30 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #ffff99; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl30 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #ffff99; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl30 align=right>1 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #ffff99; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl30 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>0 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>1 </TD></TR><TR style="HEIGHT: 12pt" height=16><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; HEIGHT: 12pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 height=16 align=right>6 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>5 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>4 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>3 </TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: #f3f3f3; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl29 align=right>2 </TD></TR></TBODY></TABLE>

First, the elements are zero-based (which is why I added one to the values in the workbook I posted for you).

Second, the method essentially does all the combinations of 5 choose 5 (there's just one), then 6 choose 5 (that's five more), then 7 choose 5 (15 more), ...
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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