View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Please Help!! VLOOKUP AND COMBINATION FUNCTION

Hi,

try this

On your worksheet create a named range called "MyMates" No quotes and enter
your names in the range
Right click the sheet tab - view code and paste this in

Sub stantial()
Count = 0
For i = 1 To Application.WorksheetFunction.CountA(Range("myMate s"))
For j = i + 1 To Application.WorksheetFunction.CountA(Range("MyMate s"))
Name1 = Range("MyMates").Cells(i, 1)
Name2 = Range("MyMates").Cells(j, 1)
Count = Count + 1
If Name2 < "" Then
Cells(2 + Count, 3) = Name1
Cells(2 + Count, 4) = Name2
End If
Next j
Next i
End Sub


Mike

"Yossy" wrote:

Possible two-person teams that can be formed from 8 candidates (28) i.e
=COMBIN(8,2).

However, my question is Lets assume the list of all 8 candidates names' are
John, Dustin, Mary, David, Peter, Rossy, Liz and Mike. How do I get the list
of all the two-person team that will total 28. All help will be appreciated.

I was thinking of using the vlookup together with the COMBIN function but
can't figure it out. Let me know if there is a better way to acheive this.
Thanks